text
stringlengths
7
1.01M
/* WARNING: THIS FILE IS AUTO-GENERATED. DO NOT MODIFY. This file was generated from .idl using "rtiddsgen". The rtiddsgen tool is part of the RTI Connext distribution. For more information, type 'rtiddsgen -help' at a command shell or consult the RTI Connext manual. */ package rapid.ext.astrobee; /** Grab control of an agent */ /** Initialize bias. */ /** Command used to load a nodelet in the system. Doesn't work with nodes running on the HLP. */ /** Type of nodelet (namespace/classname). The type is specified in the system monitor config file so you may not need to specify this. */ /** Name of nodelet manager. This should be unnecessary since the system monitor should have received a heartbeat at startup from the node and the nodelet manager name is in the heartbeat. The system monitor saves it and should be able to use it to load nodelets. If commands fails, you may want to try to specify it. */ /** Can be left blank. */ /** Reset ekf. */ /** This command is used to switch between localization pipelines. */ /** Specify which pipeline to switch to. */ /** Command used to unload a nodelet in the system. Doesn't work with nodes running on the HLP. With great power comes great responsibility! Don't unload a nodelet crucial to the system!! */ /** This should be unnecessary since the system monitor should have received a heartbeat at startup from the node and the heartbeat contains thenodelet manager name. If the command fails, you may want to try to specify it. */ /** This command is used to unterminate the robot. It will only reset the terminate flag but will not start up the pmcs or repower the payloads. */ /** This command wakes astrobee from a hibernated state into a nominal state. */ /** This command wakes astrobee from a hibernated state into a safe state. */ /** Erases everything on the hlp. */ /** Move arm while perched to control camera angle */ /** Whether to perform a pan, tilt, or both. */ /** Open or close gripper */ /** Clear data */ /** Start downloading data */ /** Set data-to-disk configuration to be the data-to-disk file most recently uplinked; the file specifies which data to save to free flyer onboard storage, and at what rates */ /** Starts the recording of the topics configured with the set data to disk command. */ /** Stop downloading data */ /** Stops the recording of the topics configured with the set data to disk command. */ /** Pass data to guest science APK */ /** Specify which guest science APK to send the data to */ /** The data to send (e.g. could be JSON-encoded data structure) */ /** Start guest science APK */ /** Specify which guest science APK to start */ /** Terminate guest science APK */ /** Specify which guest science APK to terminate */ /** Dock Astrobee. Must meet dock approach preconditions (positioned at dock approach point, etc). */ /** Berth number can only be 1 or 2. */ /** Stop propulsion impeller motors */ /** It takes the prop modules a couple of seconds to ramp up to the requested flight mode if not already at that flight mode. This command ramps up the prop modules so that when a move command is issued, it will execute right away. This doesn't need to be used for nominal use but may be used/needed for astrobee synchronization. */ /** Undock Astrobee */ /** Pause the running plan */ /** Run the loaded plan */ /** Set active plan to be the plan file that was most recently uploaded */ /** Skip next trajectory or command in the plan */ /** Pause plan for specified duration. Do nothing if docked/perched, otherwise station keep. */ /** seconds to pause */ /** Power off an item within Astrobee */ /** Any component within Astrobee that can be turned on or off. */ /** Power on an item within Astrobee */ /** Any component within Astrobee that can be turned on or off. */ /** Generic command used to make up a command after the Control Station freeze. */ /** Set camera parameters. */ /** Camera name */ /** Desired camera mode. Either streaming or recording. */ /** Desired frame size in pixels. */ /** Applies to both modes of camera. */ /** Only for sci camera; related to quality, may change name to bitrate. */ /** Set camera to record video. */ /** Camera name */ /** Record camera video. */ /** Set streaming camera video to the ground. */ /** Camera name */ /** Send live video to the ground. */ /** Command to turn on and off the obstacle detector */ /** Command to turn on and off checking keepout zones */ /** Command to allow auto return */ /** This command is only used for segments in a plan. Currently GDS does not handle timestamps since it is so tricky to get them right. So plan timestamps start at 0 and are not used by mobility since the Astrobee's system time is not 0. Thus in the nominal case set enable immediate should be set to true so that every segment sent to the mobility subsystem will be started immediately. If someone wants to do synchronized Astrobee movement, they can create plans by hand and have the timestamps start in the future. They will also have to set enable immediate to false so that the mobility system abides by the timestamp. Please note that these plans need to be started close to the first timestamp. If they are not, you could end up waiting a long time for the robot to start moving. Also the timestamp cannot be in the past or the segment will be skipped. It is probably easier to juse use GDS plan. To do this, you will want to upload the plans to the robots, use the prepare command to get the robots ready to move, and then run the plans. There could be up to a half of a second delay between the robots starting their plans. See the set time sync command. Astrobee to Astrobee communication is in the works and may solve synchronizing Astrobees in a better way. */ /** Specify which flashlight. */ /** Brightness percentage between 0 - 1 */ /** Command to allow blind flying */ /** Set mass and inertia matrix for Astrobee control */ /** The center of mass of Astrobee. */ /** The moment of inertia tensor. Must be a symmetric matrix. */ /** Change the value of Astrobee operating limits */ /** Defines GN&C gains, hard limits, tolerances, etc. */ /** The maximum linear velocity to target while translating */ /** The maximum linear acceleration to target while translating */ /** The maximum angular velocity to target while rotating */ /** The maximum angular acceleration to target while rotating */ /** Minimum distance margin to maintain away from obstacles */ /** This command is used to switch planners. */ /** Specify which planner to switch to. */ /** Change the frequency at which one type of telemetry is sent to GDS */ /** This command is used to help with Astrobee synchronization. It will try to account for the delay in communication between the ground and space and the time it takes to plan and validate a segment. This will hopefully result in two Astrobees starting to move at the same time. */ /** Set active keepout zones to be the zones file that was most recently uploaded */ public class SETTINGS_CAMERA_NAME_DOCK { public static final String VALUE = "Dock"; }
/*<license> Copyright 2004 - $Date$ by PeopleWare n.v.. 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. </license>*/ package org.ppwcode.vernacular.value_III; import static org.ppwcode.util.test.contract.Contract.contractFor; import static org.ppwcode.vernacular.exception_II.ProgrammingErrors.unexpectedException; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.ppwcode.util.test.contract.NoSuchContractException; import org.ppwcode.vernacular.value_III.stubs.StubMutableValue; import org.ppwcode.vernacular.value_III.stubs.StubValue; public class MutableValueTest { public static _Contract_MutableValue CONTRACT; static { try { CONTRACT = (_Contract_MutableValue)contractFor(MutableValue.class); } catch (NoSuchContractException exc) { unexpectedException(exc); } } private StubMutableValue $subject; @Before public void setUp() throws Exception { $subject = new StubMutableValue(); } @After public void tearDown() throws Exception { $subject = null; } @Test public void testMutableValue() { MutableValue subject = new StubMutableValue(); CONTRACT.assertInvariants(subject); } @Test public void testEqualsObject1() { Object other = new Object(); testEquals_Object(other); } @Test public void testEqualsObject2() { Object other = null; testEquals_Object(other); } @Test public void testEqualsObject3() { Object other = new StubValue(); testEquals_Object(other); } @Test public void testEqualsObject3a() { Object other = new StubMutableValue(); testEquals_Object(other); } @Test public void testEqualsObject4() { Object other = $subject; testEquals_Object(other); } private void testEquals_Object(Object other) { boolean result = $subject.equals(other); CONTRACT.assertEqualsObject($subject, other, result); CONTRACT.assertInvariants($subject); } @Test public void testClone() { MutableValue mv = $subject.clone(); CONTRACT.assertClone($subject, mv); CONTRACT.assertInvariants(mv); CONTRACT.assertInvariants($subject); } }
package model; import java.util.Arrays; /** * Class describing a vehicle. Also contains all properties of a circular unit. */ public class Vehicle extends CircularUnit { private final long playerId; private final int durability; private final int maxDurability; private final double maxSpeed; private final double visionRange; private final double squaredVisionRange; private final double groundAttackRange; private final double squaredGroundAttackRange; private final double aerialAttackRange; private final double squaredAerialAttackRange; private final int groundDamage; private final int aerialDamage; private final int groundDefence; private final int aerialDefence; private final int attackCooldownTicks; private final int remainingAttackCooldownTicks; private final VehicleType type; private final boolean aerial; private final boolean selected; private final int[] groups; public Vehicle( long id, double x, double y, double radius, long playerId, int durability, int maxDurability, double maxSpeed, double visionRange, double squaredVisionRange, double groundAttackRange, double squaredGroundAttackRange, double aerialAttackRange, double squaredAerialAttackRange, int groundDamage, int aerialDamage, int groundDefence, int aerialDefence, int attackCooldownTicks, int remainingAttackCooldownTicks, VehicleType type, boolean aerial, boolean selected, int[] groups) { super(id, x, y, radius); this.playerId = playerId; this.durability = durability; this.maxDurability = maxDurability; this.maxSpeed = maxSpeed; this.visionRange = visionRange; this.squaredVisionRange = squaredVisionRange; this.groundAttackRange = groundAttackRange; this.squaredGroundAttackRange = squaredGroundAttackRange; this.aerialAttackRange = aerialAttackRange; this.squaredAerialAttackRange = squaredAerialAttackRange; this.groundDamage = groundDamage; this.aerialDamage = aerialDamage; this.groundDefence = groundDefence; this.aerialDefence = aerialDefence; this.attackCooldownTicks = attackCooldownTicks; this.remainingAttackCooldownTicks = remainingAttackCooldownTicks; this.type = type; this.aerial = aerial; this.selected = selected; this.groups = Arrays.copyOf(groups, groups.length); } public Vehicle(Vehicle vehicle, VehicleUpdate vehicleUpdate) { super(vehicle.getId(), vehicleUpdate.getX(), vehicleUpdate.getY(), vehicle.getRadius()); this.playerId = vehicle.playerId; this.durability = vehicleUpdate.getDurability(); this.maxDurability = vehicle.maxDurability; this.maxSpeed = vehicle.maxSpeed; this.visionRange = vehicle.visionRange; this.squaredVisionRange = vehicle.squaredVisionRange; this.groundAttackRange = vehicle.groundAttackRange; this.squaredGroundAttackRange = vehicle.squaredGroundAttackRange; this.aerialAttackRange = vehicle.aerialAttackRange; this.squaredAerialAttackRange = vehicle.squaredAerialAttackRange; this.groundDamage = vehicle.groundDamage; this.aerialDamage = vehicle.aerialDamage; this.groundDefence = vehicle.groundDefence; this.aerialDefence = vehicle.aerialDefence; this.attackCooldownTicks = vehicle.attackCooldownTicks; this.remainingAttackCooldownTicks = vehicleUpdate.getRemainingAttackCooldownTicks(); this.type = vehicle.type; this.aerial = vehicle.aerial; this.selected = vehicleUpdate.isSelected(); int[] updateGroups = vehicleUpdate.getGroups(); this.groups = Arrays.copyOf(updateGroups, updateGroups.length); } /** * @return owner player's ID. */ public long getPlayerId() { return playerId; } /** * @return current durability. */ public int getDurability() { return durability; } /** * @return maximal durability. */ public int getMaxDurability() { return maxDurability; } /** * @return maximal distance that can be travelled in one tick * when not affected by terrain or weather. While rotating arc length is taken into account, * not the distance between start and finish positions. */ public double getMaxSpeed() { return maxSpeed; } /** * @return maximal range (from center to center) at which this vehicle can detect other objects, * when not affected by terrain or weather. */ public double getVisionRange() { return visionRange; } /** * @return squared maximal range (from center to center) at which this vehicle can detect other objects, * when not affected by terrain or weather. */ public double getSquaredVisionRange() { return squaredVisionRange; } /** * @return maximal range (from center to center) at which this vehicle can attack ground units. */ public double getGroundAttackRange() { return groundAttackRange; } /** * @return squared maximal range (from center to center) at which this vehicle can attack ground units. */ public double getSquaredGroundAttackRange() { return squaredGroundAttackRange; } /** * @return maximal range (from center to center) at which this vehicle can attack aerial units. */ public double getAerialAttackRange() { return aerialAttackRange; } /** * @return squared maximal range (from center to center) at which this vehicle can attack aerial units. */ public double getSquaredAerialAttackRange() { return squaredAerialAttackRange; } /** * @return damage of one attack dealt to a ground unit. */ public int getGroundDamage() { return groundDamage; } /** * @return damage of one attack dealt to an aerial unit. */ public int getAerialDamage() { return aerialDamage; } /** * @return value of defence from ground units' attacks. */ public int getGroundDefence() { return groundDefence; } /** * @return value of defence from aerial units' attacks. */ public int getAerialDefence() { return aerialDefence; } /** * @return minimal possible interval between attacks. */ public int getAttackCooldownTicks() { return attackCooldownTicks; } /** * @return amount of ticks before the vehicle can attack again. * In order to attack this value has to be equal zero. */ public int getRemainingAttackCooldownTicks() { return remainingAttackCooldownTicks; } /** * @return vehicle's type. */ public VehicleType getType() { return type; } /** * @return {@code true} iff the vehicle is aerial. */ public boolean isAerial() { return aerial; } /** * @return {@code true} iff the vehicle is selected. */ public boolean isSelected() { return selected; } /** * @return list of groups that the vehicle belongs to. */ public int[] getGroups() { return Arrays.copyOf(groups, groups.length); } }
/* * Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Distribution License v. 1.0, which is available at * http://www.eclipse.org/org/documents/edl-v10.php. * * SPDX-License-Identifier: BSD-3-Clause */ package fromjava.wsa.responses.server; import jakarta.jws.WebService; import jakarta.xml.ws.soap.Addressing; import jakarta.xml.ws.soap.AddressingFeature; /** * @author Rama Pulavarthi */ @WebService(portName="AllResponsesEndpoint") @Addressing(responses= AddressingFeature.Responses.ALL) public class AllResponsesEndpoint extends AddNumbersImpl{ }
package com.chrisleung.notifications.tools.restapi.benchmark; import java.util.ArrayList; import java.util.Date; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.web.client.RestTemplate; public class DeleteNotificationRequest extends Request { DeleteNotificationRequest(RestTemplate r, String endpoint, String id, ArrayList<CompletedRequest> c) { super(r, endpoint, id, c); } @Override public void run() { ResponseEntity<PostNotificationResponse> response = restTemplate.exchange(url, HttpMethod.DELETE, null, PostNotificationResponse.class); CompletedRequest completedRequest = new CompletedRequest(new Date(), response.getBody().getId()); addCompletedRequest(completedRequest); } }
/* * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.springframework.boot.jackson; import java.lang.annotation.Documented; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonSerializer; import org.springframework.core.annotation.AliasFor; import org.springframework.stereotype.Component; /** * {@link Component} that provides {@link JsonSerializer} and/or {@link JsonDeserializer} * implementations to be registered with Jackson when {@link JsonComponentModule} is in * use. Can be used to annotate {@link JsonSerializer} or {@link JsonDeserializer} * implementations directly or a class that contains them as inner-classes. For example: * <pre class="code"> * &#064;JsonComponent * public class CustomerJsonComponent { * * public static class Serializer extends JsonSerializer&lt;Customer&gt; { * * // ... * * } * * public static class Deserializer extends JsonDeserializer&lt;Customer&gt; { * * // ... * * } * * } * * </pre> * * @see JsonComponentModule * @since 1.4.0 * @author Phillip Webb */ @Target(ElementType.TYPE) @Retention(RetentionPolicy.RUNTIME) @Documented @Component public @interface JsonComponent { /** * The value may indicate a suggestion for a logical component name, to be turned into * a Spring bean in case of an autodetected component. * @return the component name */ @AliasFor(annotation = Component.class) String value() default ""; }
/* * Copyright 2015 E.Hooijmeijer / www.ctrl-alt-dev.nl * * 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 nl.ctrlaltdev.json.transform.mapping; import nl.ctrlaltdev.json.transform.path.ValuePath; import nl.ctrlaltdev.json.transform.select.Select; import nl.ctrlaltdev.json.transform.transforms.MappingTransform; import nl.ctrlaltdev.json.transform.transforms.ValuePathTransform; /** * The select of the Transform select is tested against each node and if * it matches, the transform is executed. For arrays and objects the * select is tested by default at the start of the node, however for * some purposes its best to test at the end of the node. The post * boolean makes the transform select execute at the end of the node. * * Works with the {@link MappingTransform}. */ public class TransformSelect { private ValuePathTransform transform; private Select select; private boolean post; public TransformSelect(ValuePathTransform transform, Select select) { this(transform, select, false); } public TransformSelect(ValuePathTransform transform, Select select, boolean post) { this.transform = transform; this.select = select; this.post = post; } public boolean isPost() { return post; } public boolean isMatch(ValuePath path) { return select.isMatch(path); } public void apply(ValuePath source, ValuePath target) { transform.apply(source, target); } }
package org.jetbrains.skija; import java.util.Arrays; import org.jetbrains.skija.test.Executable; import org.jetbrains.skija.test.TestRunner; import static org.jetbrains.skija.test.TestRunner.assertArrayEquals; import static org.jetbrains.skija.test.TestRunner.assertEquals; import static org.jetbrains.skija.test.TestRunner.assertNotEquals; public class TypefaceTest implements Executable { @Override public void execute() throws Exception { boolean isLinux = System.getProperty("os.name").equals("Linux"); Typeface inter = Typeface.makeFromFile("src/test/resources/fonts/Inter-Regular.ttf"); Typeface interV = Typeface.makeFromFile("src/test/resources/fonts/Inter-V.otf"); Typeface jbMono = Typeface.makeFromFile("src/test/resources/fonts/JetBrainsMono-Regular.ttf"); Typeface jbMonoBold = Typeface.makeFromData(Data.makeFromFileName("src/test/resources/fonts/JetBrainsMono-Bold.ttf")); assertEquals(FontStyle.NORMAL, inter.getFontStyle()); assertEquals(false, inter.isBold()); assertEquals(false, inter.isItalic()); assertEquals(FontStyle.BOLD, jbMonoBold.getFontStyle()); assertEquals(true, jbMonoBold.isBold()); assertEquals(false, jbMonoBold.isItalic()); assertEquals(false, inter.isFixedPitch()); assertEquals(true, jbMono.isFixedPitch()); assertArrayEquals(null, inter.getVariationPosition()); assertArrayEquals(new FontVariation[] { new FontVariation("wght", 400), new FontVariation("slnt", 0) }, interV.getVariationPosition()); Typeface inter500 = interV.makeClone(new FontVariation("wght", 500)); assertNotEquals(inter500, interV); assertArrayEquals(new FontVariation[] { new FontVariation("wght", 500), new FontVariation("slnt", 0) }, inter500.getVariationPosition()); Typeface inter400 = interV.makeClone(new FontVariation("wght", 400)); // assertEquals(inter400, interV); assertNotEquals(inter.getUniqueId(), interV.getUniqueId()); assertNotEquals(inter, interV); assertNotEquals(null, Typeface.makeDefault()); if (!isLinux) assertEquals("Arial", Typeface.makeFromName("Arial", FontStyle.NORMAL).getFamilyName()); int[] Skia = new int[] { 83, 107, 105, 97 }; assertArrayEquals(new short[] { 393, 709, 673, 501 }, inter.getUTF32GlyphIds(Skia)); assertArrayEquals(new short[] { 393, 709, 673, 501 }, inter.getStringGlyphIds("Skia")); assertEquals(Short.valueOf((short) 393), inter.getUTF32GlyphId(83)); assertEquals(2538, interV.getGlyphsCount()); assertEquals(17, inter.getTablesCount()); // assertArrayEquals(null, inter.getTableTags()); assertArrayEquals(new String[] {"GDEF", "GPOS", "GSUB", "OS/2", "cmap", "cvt ", "fpgm", "gasp", "glyf", "head", "hhea", "hmtx", "loca", "maxp", "name", "post", "prep"}, inter.getTableTags()); assertEquals(true, inter.getTableData("loca").getSize() > 0); assertEquals(2816, inter.getUnitsPerEm()); assertArrayEquals(null, jbMono.getKerningPairAdjustments(null)); assertArrayEquals(null, jbMono.getKerningPairAdjustments(jbMono.getStringGlyphIds("TAV"))); // assertEquals(null, interV.getKerningPairAdjustments(null)); // assertArrayEquals(null, interV.getKerningPairAdjustments(interV.getStringGlyphIds("TAV"))); assertArrayEquals(new FontFamilyName[] { new FontFamilyName("Inter V", "en-US") }, interV.getFamilyNames()); assertEquals("Inter V", interV.getFamilyName()); // if (!isLinux) // assertEquals(Rect.makeLTRB(-0.7386364f, -1.0909119f, 2.5830965f, 0.31959534f), interV.getBounds()); } }
package org.roaringbitmap.circuits.adder; import java.util.Arrays; import org.roaringbitmap.RoaringBitmap; /** * A adder will add the bitmaps as 0-1 counters. * */ public class BSTMAdder implements Adder { @Override public RoaringBitmap[] add(RoaringBitmap... set) { final int numSumBitmaps = 32 - Integer.numberOfLeadingZeros(set.length); int lastBitSlice = 0; RoaringBitmap[] acc = new RoaringBitmap[numSumBitmaps + 1]; // null // sentinel // at end acc[0] = set[0]; for (int k = 1; k < set.length; ++k) { RoaringBitmap c = RoaringBitmap.and(set[k], acc[0]); if (k == 1) acc[0] = RoaringBitmap.xor(acc[0], set[k]); else acc[0].xor(set[k]); int i; for (i = 1; acc[i] != null; ++i) { RoaringBitmap temp1 = RoaringBitmap.xor(acc[i], c); c.and(acc[i]); acc[i] = temp1; } if (!c.isEmpty()) { acc[i] = c; lastBitSlice = i; } } return Arrays.copyOf(acc, lastBitSlice + 1); } }
package responsibility.handler; /** * @Author: Jeremy * @Date: 2020/9/1 22:12 */ public class StudentHandler extends Handler { @Override protected void doHandle(ScholarshipApplyForm form) { form.setStatus("The form has been fulfilled. Wait for mentor to sign."); } }
package com.alipay.api.response; import com.alipay.api.internal.mapping.ApiField; import com.alipay.api.AlipayResponse; /** * ALIPAY API: alipay.marketing.card.template.modify response. * * @author auto create * @since 1.0, 2019-08-08 19:58:29 */ public class AlipayMarketingCardTemplateModifyResponse extends AlipayResponse { private static final long serialVersionUID = 5799392885428511662L; /** * 模板ID */ @ApiField("template_id") private String templateId; public void setTemplateId(String templateId) { this.templateId = templateId; } public String getTemplateId( ) { return this.templateId; } }
package org.swrlapi.factory; import org.checkerframework.checker.nullness.qual.NonNull; import org.semanticweb.owlapi.model.OWLDataProperty; import org.semanticweb.owlapi.model.OWLDataPropertyExpression; import org.swrlapi.builtins.arguments.SWRLBuiltInArgumentType; import org.swrlapi.builtins.arguments.SWRLBuiltInArgumentVisitor; import org.swrlapi.builtins.arguments.SWRLBuiltInArgumentVisitorEx; import org.swrlapi.builtins.arguments.SWRLDataPropertyBuiltInArgument; import org.swrlapi.exceptions.SWRLBuiltInException; class DefaultSWRLDataPropertyBuiltInArgument extends DefaultSWRLNamedBuiltInArgument implements SWRLDataPropertyBuiltInArgument { private static final long serialVersionUID = 1L; public DefaultSWRLDataPropertyBuiltInArgument(@NonNull OWLDataProperty property) { super(property); } @NonNull @Override public SWRLBuiltInArgumentType<?> getSWRLBuiltInArgumentType() { return SWRLBuiltInArgumentType.DATA_PROPERTY; } @NonNull @Override public OWLDataProperty getOWLDataProperty() { return getOWLEntity().asOWLDataProperty(); } @NonNull @Override public OWLDataPropertyExpression getOWLDataPropertyExpression() { return getOWLDataProperty(); } @NonNull @Override public <@NonNull T> T accept(@NonNull SWRLBuiltInArgumentVisitorEx<@NonNull T> visitor) { return visitor.visit(this); } @NonNull @Override public SWRLDataPropertyBuiltInArgument asSWRLDataPropertyBuiltInArgument() throws SWRLBuiltInException { return this; } @NonNull @Override public SWRLDataPropertyBuiltInArgument asSWRLDataPropertyExpressionBuiltInArgument() throws SWRLBuiltInException { return this; } @Override public void accept(@NonNull SWRLBuiltInArgumentVisitor visitor) { visitor.visit(this); } }
package com.zuolg.fairytaleworld.view; public interface HomeView { /** * 加载 */ public void onLoad(); /** * 更新 */ public void onRefresh(); /** * 更新 */ public void onReset(); /** * 提交 */ public void onCommit(); /** * 显示错误 * * @param msg */ public void showError(String msg); /** * 显示进度条 */ public void showProgressDialog(); /** * 隐藏进度条 */ public void hideProgressDialog(); }
/* * Copyright (c) 2004 World Wide Web Consortium, * * (Massachusetts Institute of Technology, European Research Consortium for * Informatics and Mathematics, Keio University). All Rights Reserved. This * work is distributed under the W3C(r) Software License [1] in the hope that * it will be useful, but WITHOUT ANY WARRANTY; without even the implied * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * * [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 */ package org.w3c.dom.ls; /** * <code>LSResourceResolver</code> provides a way for applications to * redirect references to external resources. * <p> Applications needing to implement custom handling for external * resources can implement this interface and register their implementation * by setting the "resource-resolver" parameter of * <code>DOMConfiguration</code> objects attached to <code>LSParser</code> * and <code>LSSerializer</code>. It can also be register on * <code>DOMConfiguration</code> objects attached to <code>Document</code> * if the "LS" feature is supported. * <p> The <code>LSParser</code> will then allow the application to intercept * any external entities, including the external DTD subset and external * parameter entities, before including them. The top-level document entity * is never passed to the <code>resolveResource</code> method. * <p> Many DOM applications will not need to implement this interface, but it * will be especially useful for applications that build XML documents from * databases or other specialized input sources, or for applications that * use URN's. * <p ><b>Note:</b> <code>LSResourceResolver</code> is based on the SAX2 [<a href='http://www.saxproject.org/'>SAX</a>] <code>EntityResolver</code> * interface. */ public interface LSResourceResolver { /** * Allow the application to resolve external resources. * <br> The <code>LSParser</code> will call this method before opening any * external resource, including the external DTD subset, external * entities referenced within the DTD, and external entities referenced * within the document element (however, the top-level document entity * is not passed to this method). The application may then request that * the <code>LSParser</code> resolve the external resource itself, that * it use an alternative URI, or that it use an entirely different input * source. * <br> Application writers can use this method to redirect external * system identifiers to secure and/or local URI, to look up public * identifiers in a catalogue, or to read an entity from a database or * other input source (including, for example, a dialog box). * @param type The type of the resource being resolved. For XML [<a href='http://www.w3.org/TR/2000/REC-xml-20001006'>XML 1.0</a>] resources * (i.e. entities), applications must use the value * <code>"http://www.w3.org/TR/REC-xml"</code>, for XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>] * , applications must use the value * <code>"http://www.w3.org/2001/XMLSchema"</code>. Other types of * resources are outside the scope of this specification and therefore * should recommend an absolute URI in order to use this method. * @param namespaceURI The namespace of the resource being resolved, * e.g. the target namespace of the XML Schema [<a href='http://www.w3.org/TR/2001/REC-xmlschema-1-20010502/'>XML Schema Part 1</a>] * when resolving XML Schema resources. * @param publicId The public identifier of the external entity being * referenced, or <code>null</code> if no public identifier was * supplied or if the resource is not an entity. * @param systemId The system identifier, a URI reference [<a href='http://www.ietf.org/rfc/rfc2396.txt'>IETF RFC 2396</a>], of the * external resource being referenced, or <code>null</code> if no * system identifier was supplied. * @param baseURI The absolute base URI of the resource being parsed, or * <code>null</code> if there is no base URI. * @return A <code>LSInput</code> object describing the new input * source, or <code>null</code> to request that the parser open a * regular URI connection to the resource. */ public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI); }
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.shardingsphere.ui.repository; import org.apache.shardingsphere.ui.common.domain.RegistryCenterConfigs; /** * Registry center configs repository interface. * * @author chenqingyang */ public interface RegistryCenterConfigsRepository { /** * Load registry center configs. * * @return registry center configs */ RegistryCenterConfigs load(); /** * Save registry center configs. * * @param registryCenterConfigs registry center configs */ void save(RegistryCenterConfigs registryCenterConfigs); }
package com.jiahaoliuliu.chapter3.stacksandqueues.q2stackmin; import java.util.EmptyStackException; public class Q2MyStackMin { private Node top; private static class Node { private final int data; /** * The minimum is used to take a snapshot of the minimum * values on its substack */ private int minimum; private Node next; public Node(int data) { this.data = data; this.minimum = Integer.MAX_VALUE; } } public void push(int data) { Node newNode = new Node(data); if (top == null) { newNode.minimum = data; } else { newNode.minimum = Math.min(data, top.minimum); } newNode.next = top; top = newNode; } public int pop() { if (top == null) throw new EmptyStackException(); int item = top.data; top = top.next; return item; } public int peek() { if (top == null) throw new EmptyStackException(); return top.data; } public int min() { if (top == null) throw new EmptyStackException(); return top.minimum; } public boolean isEmpty() { return top == null; } }
/** * Refer to this link https://stackoverflow.com/a/50958900 to learn how to run tags from within * IntelliJ. */ package com.rationaleemotions.tags;
package com.flipkart.foxtrot.server.resources; import com.codahale.metrics.annotation.Timed; import com.flipkart.foxtrot.server.cluster.ClusterManager; import com.flipkart.foxtrot.server.cluster.ClusterMember; import com.hazelcast.cluster.Member; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import javax.annotation.security.PermitAll; import javax.inject.Inject; import javax.inject.Singleton; import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import java.util.Collection; import java.util.Collections; import java.util.Map; @Path("/v1/cluster") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @Api(value = "/v1/cluster") @Singleton @PermitAll public class ClusterInfoResource { private ClusterManager clusterManager; @Inject public ClusterInfoResource(ClusterManager clusterManager) { this.clusterManager = clusterManager; } @GET @Path("/members") @Timed @ApiOperation("Get members") public Map<String, Collection<ClusterMember>> members() { return Collections.singletonMap("members", clusterManager.getMembers()); } @GET @Path("/hazelcast/members") @Timed @ApiOperation("Get Hazelcast cluster members") public Map<String, Collection<Member>> hazelcastMembers() { return Collections.singletonMap("members", clusterManager.getHazelcastMembers()); } }
package io.quarkus.deployment.configuration; import static io.quarkus.deployment.util.ReflectUtil.rawTypeOf; import static io.quarkus.deployment.util.ReflectUtil.rawTypeOfParameter; import static io.quarkus.deployment.util.ReflectUtil.reportError; import static io.quarkus.deployment.util.ReflectUtil.toError; import static io.quarkus.deployment.util.ReflectUtil.typeOfParameter; import static io.quarkus.deployment.util.ReflectUtil.unwrapInvocationTargetException; import static io.smallrye.config.SmallRyeConfig.SMALLRYE_CONFIG_PROFILE; import static java.util.stream.Collectors.toSet; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Modifier; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; import java.util.SortedSet; import java.util.TreeMap; import org.eclipse.microprofile.config.inject.ConfigProperty; import org.eclipse.microprofile.config.spi.ConfigSource; import org.eclipse.microprofile.config.spi.Converter; import org.jboss.logging.Logger; import org.wildfly.common.Assert; import io.quarkus.deployment.configuration.definition.ClassDefinition; import io.quarkus.deployment.configuration.definition.GroupDefinition; import io.quarkus.deployment.configuration.definition.RootDefinition; import io.quarkus.deployment.configuration.matching.ConfigPatternMap; import io.quarkus.deployment.configuration.matching.Container; import io.quarkus.deployment.configuration.matching.FieldContainer; import io.quarkus.deployment.configuration.matching.MapContainer; import io.quarkus.deployment.configuration.matching.PatternMapBuilder; import io.quarkus.deployment.configuration.type.ArrayOf; import io.quarkus.deployment.configuration.type.CollectionOf; import io.quarkus.deployment.configuration.type.ConverterType; import io.quarkus.deployment.configuration.type.Leaf; import io.quarkus.deployment.configuration.type.LowerBoundCheckOf; import io.quarkus.deployment.configuration.type.MinMaxValidated; import io.quarkus.deployment.configuration.type.OptionalOf; import io.quarkus.deployment.configuration.type.PatternValidated; import io.quarkus.deployment.configuration.type.UpperBoundCheckOf; import io.quarkus.runtime.annotations.ConfigGroup; import io.quarkus.runtime.annotations.ConfigItem; import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; import io.quarkus.runtime.configuration.ConfigUtils; import io.quarkus.runtime.configuration.ConfigurationException; import io.quarkus.runtime.configuration.HyphenateEnumConverter; import io.quarkus.runtime.configuration.NameIterator; import io.quarkus.runtime.configuration.ProfileManager; import io.quarkus.runtime.configuration.PropertiesUtil; import io.smallrye.config.Converters; import io.smallrye.config.EnvConfigSource; import io.smallrye.config.Expressions; import io.smallrye.config.SmallRyeConfig; import io.smallrye.config.SmallRyeConfigBuilder; import io.smallrye.config.SysPropConfigSource; /** * A configuration reader. */ public final class BuildTimeConfigurationReader { private static final Logger log = Logger.getLogger("io.quarkus.config.build"); final ConfigPatternMap<Container> buildTimePatternMap; final ConfigPatternMap<Container> buildTimeRunTimePatternMap; final ConfigPatternMap<Container> bootstrapPatternMap; final ConfigPatternMap<Container> runTimePatternMap; final List<RootDefinition> buildTimeVisibleRoots; final List<RootDefinition> allRoots; final boolean bootstrapRootsEmpty; /** * Construct a new instance. * * @param configRoots the configuration root class list (must not be {@code null}) */ public BuildTimeConfigurationReader(final List<Class<?>> configRoots) { Assert.checkNotNullParam("configRoots", configRoots); List<RootDefinition> bootstrapRoots = new ArrayList<>(); List<RootDefinition> runTimeRoots = new ArrayList<>(); List<RootDefinition> buildTimeRunTimeRoots = new ArrayList<>(); List<RootDefinition> buildTimeRoots = new ArrayList<>(); Map<Class<?>, GroupDefinition> groups = new HashMap<>(); for (Class<?> configRoot : configRoots) { String prefix = "quarkus"; String name = ConfigItem.HYPHENATED_ELEMENT_NAME; ConfigPhase phase = ConfigPhase.BUILD_TIME; ConfigRoot annotation = configRoot.getAnnotation(ConfigRoot.class); if (annotation != null) { prefix = annotation.prefix(); name = annotation.name(); phase = annotation.phase(); } RootDefinition.Builder defBuilder = new RootDefinition.Builder(); defBuilder.setPrefix(prefix); defBuilder.setConfigPhase(phase); defBuilder.setRootName(name); processClass(defBuilder, configRoot, groups); RootDefinition definition = defBuilder.build(); if (phase == ConfigPhase.BUILD_TIME) { buildTimeRoots.add(definition); } else if (phase == ConfigPhase.BUILD_AND_RUN_TIME_FIXED) { buildTimeRunTimeRoots.add(definition); } else if (phase == ConfigPhase.BOOTSTRAP) { bootstrapRoots.add(definition); } else { assert phase == ConfigPhase.RUN_TIME; runTimeRoots.add(definition); } } bootstrapPatternMap = PatternMapBuilder.makePatterns(bootstrapRoots); runTimePatternMap = PatternMapBuilder.makePatterns(runTimeRoots); buildTimeRunTimePatternMap = PatternMapBuilder.makePatterns(buildTimeRunTimeRoots); buildTimePatternMap = PatternMapBuilder.makePatterns(buildTimeRoots); buildTimeVisibleRoots = new ArrayList<>(buildTimeRoots.size() + buildTimeRunTimeRoots.size()); buildTimeVisibleRoots.addAll(buildTimeRoots); buildTimeVisibleRoots.addAll(buildTimeRunTimeRoots); bootstrapRootsEmpty = bootstrapRoots.isEmpty(); List<RootDefinition> allRoots = new ArrayList<>( buildTimeVisibleRoots.size() + bootstrapRoots.size() + runTimeRoots.size()); allRoots.addAll(buildTimeVisibleRoots); allRoots.addAll(bootstrapRoots); allRoots.addAll(runTimeRoots); this.allRoots = allRoots; } private static void processClass(ClassDefinition.Builder builder, Class<?> clazz, final Map<Class<?>, GroupDefinition> groups) { builder.setConfigurationClass(clazz); processClassFields(builder, clazz, groups); } private static void processClassFields(final ClassDefinition.Builder builder, final Class<?> clazz, final Map<Class<?>, GroupDefinition> groups) { for (Field field : clazz.getDeclaredFields()) { int mods = field.getModifiers(); if (Modifier.isStatic(mods)) { continue; } if (Modifier.isFinal(mods)) { continue; } if (Modifier.isPrivate(mods)) { throw reportError(field, "Configuration field may not be private"); } if (!Modifier.isPublic(mods) || !Modifier.isPublic(clazz.getModifiers())) { field.setAccessible(true); } builder.addMember(processValue(field, field.getGenericType(), groups)); } Class<?> superclass = clazz.getSuperclass(); if (superclass != null) { processClassFields(builder, superclass, groups); } } private static ClassDefinition.ClassMember.Specification processValue(Field field, Type valueType, Map<Class<?>, GroupDefinition> groups) { Class<?> valueClass = rawTypeOf(valueType); final boolean isOptional = valueClass == Optional.class; if (valueClass == Map.class) { if (!(valueType instanceof ParameterizedType)) { throw reportError(field, "Map values must be parameterized"); } Class<?> keyClass = rawTypeOfParameter(valueType, 0); if (keyClass != String.class) { throw reportError(field, "Map key types other than String are not yet supported"); } final ClassDefinition.ClassMember.Specification nested = processValue(field, typeOfParameter(valueType, 1), groups); if (nested instanceof ClassDefinition.GroupMember.Specification && ((ClassDefinition.GroupMember.Specification) nested).isOptional()) { throw reportError(field, "Group map values may not be optional"); } return new ClassDefinition.MapMember.Specification(nested); } else if (valueClass.getAnnotation(ConfigGroup.class) != null || isOptional && rawTypeOfParameter(valueType, 0).getAnnotation(ConfigGroup.class) != null) { Class<?> groupClass; if (isOptional) { groupClass = rawTypeOfParameter(valueType, 0); } else { groupClass = valueClass; } GroupDefinition def = groups.get(groupClass); if (def == null) { final GroupDefinition.Builder subBuilder = new GroupDefinition.Builder(); processClass(subBuilder, groupClass, groups); groups.put(groupClass, def = subBuilder.build()); } return new ClassDefinition.GroupMember.Specification(field, def, isOptional); } else { final String defaultDefault; // primitive values generally get their normal initializers as a default value if (valueClass == boolean.class) { defaultDefault = "false"; } else if (valueClass.isPrimitive() && valueClass != char.class) { defaultDefault = "0"; } else { defaultDefault = null; } ConfigItem configItem = field.getAnnotation(ConfigItem.class); if (configItem != null) { final String defaultVal = configItem.defaultValue(); return new ClassDefinition.ItemMember.Specification(field, defaultVal.equals(ConfigItem.NO_DEFAULT) ? defaultDefault : defaultVal); } else { ConfigProperty configProperty = field.getAnnotation(ConfigProperty.class); if (configProperty != null) { log.warnf("Using @ConfigProperty for Quarkus configuration items is deprecated " + "(use @ConfigItem instead) at %s#%s", field.getDeclaringClass().getName(), field.getName()); final String defaultVal = configProperty.defaultValue(); return new ClassDefinition.ItemMember.Specification(field, defaultVal.equals(ConfigProperty.UNCONFIGURED_VALUE) ? defaultDefault : defaultVal); } else { // todo: should we log a warning that there is no annotation for the property, or just allow it? return new ClassDefinition.ItemMember.Specification(field, defaultDefault); } } } } public ConfigPatternMap<Container> getBuildTimePatternMap() { return buildTimePatternMap; } public ConfigPatternMap<Container> getBuildTimeRunTimePatternMap() { return buildTimeRunTimePatternMap; } public ConfigPatternMap<Container> getRunTimePatternMap() { return runTimePatternMap; } public List<RootDefinition> getBuildTimeVisibleRoots() { return buildTimeVisibleRoots; } public List<RootDefinition> getAllRoots() { return allRoots; } public ReadResult readConfiguration(final SmallRyeConfig config) { return new ReadOperation(config).run(); } final class ReadOperation { final SmallRyeConfig config; final Set<String> processedNames = new HashSet<>(); final Map<Class<?>, Object> objectsByRootClass = new HashMap<>(); final Map<String, String> specifiedRunTimeDefaultValues = new TreeMap<>(); final Map<String, String> buildTimeRunTimeVisibleValues = new TreeMap<>(); final Map<String, String> allBuildTimeValues = new TreeMap<>(); final Map<ConverterType, Converter<?>> convByType = new HashMap<>(); ReadOperation(final SmallRyeConfig config) { this.config = config; } ReadResult run() { final StringBuilder nameBuilder; nameBuilder = new StringBuilder(); for (RootDefinition root : buildTimeVisibleRoots) { Class<?> clazz = root.getConfigurationClass(); Object instance; try { Constructor<?> cons = clazz.getDeclaredConstructor(); cons.setAccessible(true); instance = cons.newInstance(); } catch (InstantiationException e) { throw toError(e); } catch (IllegalAccessException e) { throw toError(e); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } catch (NoSuchMethodException e) { throw toError(e); } objectsByRootClass.put(clazz, instance); nameBuilder.append(root.getName()); readConfigGroup(root, instance, nameBuilder); nameBuilder.setLength(0); } Set<String> registeredRoots = allRoots.stream().map(RootDefinition::getPrefix).collect(toSet()); // sweep-up SmallRyeConfig runtimeDefaultsConfig = getConfigForRuntimeDefaults(); for (String propertyName : getAllProperties(registeredRoots)) { if (propertyName.equals(ConfigSource.CONFIG_ORDINAL)) { continue; } NameIterator ni = new NameIterator(propertyName); if (ni.hasNext() && PropertiesUtil.isPropertyInRoot(registeredRoots, ni)) { // build time patterns Container matched = buildTimePatternMap.match(ni); if (matched instanceof FieldContainer) { allBuildTimeValues.put(propertyName, config.getOptionalValue(propertyName, String.class).orElse("")); ni.goToEnd(); // cursor is located after group property key (if any) getGroup((FieldContainer) matched, ni); // we don't have to set the field because the group object init does it for us continue; } else if (matched != null) { assert matched instanceof MapContainer; // it's a leaf value within a map // these must always be explicitly set ni.goToEnd(); // cursor is located after the map key final String key = ni.getPreviousSegment(); final Map<String, Object> map = getMap((MapContainer) matched, ni); // we always have to set the map entry ourselves Field field = matched.findField(); Converter<?> converter = getConverter(config, field, ConverterType.of(field)); map.put(key, config.getValue(propertyName, converter)); allBuildTimeValues.put(propertyName, config.getOptionalValue(propertyName, String.class).orElse("")); continue; } // build time (run time visible) patterns ni.goToStart(); matched = buildTimeRunTimePatternMap.match(ni); if (matched instanceof FieldContainer) { ni.goToEnd(); // cursor is located after group property key (if any) getGroup((FieldContainer) matched, ni); allBuildTimeValues.put(propertyName, config.getOptionalValue(propertyName, String.class).orElse("")); buildTimeRunTimeVisibleValues.put(propertyName, config.getOptionalValue(propertyName, String.class).orElse("")); continue; } else if (matched != null) { assert matched instanceof MapContainer; // it's a leaf value within a map // these must always be explicitly set ni.goToEnd(); // cursor is located after the map key final String key = ni.getPreviousSegment(); final Map<String, Object> map = getMap((MapContainer) matched, ni); // we always have to set the map entry ourselves Field field = matched.findField(); Converter<?> converter = getConverter(config, field, ConverterType.of(field)); map.put(key, config.getValue(propertyName, converter)); // cache the resolved value buildTimeRunTimeVisibleValues.put(propertyName, config.getOptionalValue(propertyName, String.class).orElse("")); allBuildTimeValues.put(propertyName, config.getOptionalValue(propertyName, String.class).orElse("")); continue; } // run time patterns ni.goToStart(); matched = runTimePatternMap.match(ni); if (matched != null) { // it's a specified run-time default (record for later) specifiedRunTimeDefaultValues.put(propertyName, Expressions.withoutExpansion( () -> runtimeDefaultsConfig.getOptionalValue(propertyName, String.class).orElse(""))); continue; } // also check for the bootstrap properties since those need to be added to specifiedRunTimeDefaultValues as well ni.goToStart(); matched = bootstrapPatternMap.match(ni); if (matched != null) { // it's a specified run-time default (record for later) specifiedRunTimeDefaultValues.put(propertyName, Expressions.withoutExpansion( () -> runtimeDefaultsConfig.getOptionalValue(propertyName, String.class).orElse(""))); } } else { // it's not managed by us; record it specifiedRunTimeDefaultValues.put(propertyName, Expressions.withoutExpansion( () -> runtimeDefaultsConfig.getOptionalValue(propertyName, String.class).orElse(""))); } } filterActiveProfileProperties(buildTimeRunTimeVisibleValues); filterActiveProfileProperties(specifiedRunTimeDefaultValues); return new ReadResult(objectsByRootClass, specifiedRunTimeDefaultValues, buildTimeRunTimeVisibleValues, allBuildTimeValues, buildTimePatternMap, buildTimeRunTimePatternMap, bootstrapPatternMap, runTimePatternMap, allRoots, bootstrapRootsEmpty); } /** * Get a matched group. The tree node points to the property within the group that was matched. * * @param matched the matcher tree node * @param ni the name iterator, positioned <em>after</em> the group member key (if any) * @return the (possibly new) group instance */ private Object getGroup(FieldContainer matched, NameIterator ni) { final ClassDefinition.ClassMember classMember = matched.getClassMember(); ClassDefinition definition = matched.findEnclosingClass(); Class<?> configurationClass = definition.getConfigurationClass(); if (definition instanceof RootDefinition) { // found the root return objectsByRootClass.get(configurationClass); } Container parent = matched.getParent(); final boolean consume = !classMember.getPropertyName().isEmpty(); if (consume) { ni.previous(); } // now the cursor is *before* the group member key but after the base group if (parent instanceof FieldContainer) { FieldContainer parentClass = (FieldContainer) parent; Field field = parentClass.findField(); // the cursor is located after the enclosing group's property name (if any) Object enclosing = getGroup(parentClass, ni); // cursor restored to after group member key if (consume) { ni.next(); } if ((classMember instanceof ClassDefinition.GroupMember) && ((ClassDefinition.GroupMember) classMember).isOptional()) { Optional<?> opt; try { opt = (Optional<?>) field.get(enclosing); } catch (IllegalAccessException e) { throw toError(e); } if (opt.isPresent()) { return opt.get(); } else { Object instance = recreateGroup(ni, definition, configurationClass); try { field.set(enclosing, Optional.of(instance)); } catch (IllegalAccessException e) { throw toError(e); } return instance; } } else { try { return field.get(enclosing); } catch (IllegalAccessException e) { throw toError(e); } } } else { assert parent instanceof MapContainer; final MapContainer parentMap = (MapContainer) parent; Map<String, Object> map = getMap(parentMap, ni); // the base group is a map, so the previous segment is the key of the map String key = ni.getPreviousSegment(); Object instance = map.get(key); if (instance == null) { instance = recreateGroup(ni, definition, configurationClass); map.put(key, instance); } // cursor restored to after group member key if (consume) { ni.next(); } return instance; } } /** * Get a matched map. The tree node points to the position after the map key. * * @param matched the matcher tree node * @param ni the name iterator, positioned just <em>after</em> the map key; restored on exit * @return the map */ private Map<String, Object> getMap(MapContainer matched, NameIterator ni) { Container parent = matched.getParent(); if (parent instanceof FieldContainer) { FieldContainer parentClass = (FieldContainer) parent; Field field = parentClass.findField(); ni.previous(); // now the cursor is before our map key and after the enclosing group property (if any) Object instance = getGroup(parentClass, ni); ni.next(); // cursor restored try { return getFieldAsMap(field, instance); } catch (IllegalAccessException e) { throw toError(e); } } else { assert parent instanceof MapContainer; ni.previous(); // now the cursor is before our map key and after the enclosing map key Map<String, Object> map = getMap((MapContainer) parent, ni); String key = ni.getPreviousSegment(); ni.next(); // cursor restored Map<String, Object> instance = getAsMap(map, key); if (instance == null) { instance = new HashMap<>(); map.put(key, instance); } return instance; } } private Object recreateGroup(final NameIterator ni, final ClassDefinition definition, final Class<?> configurationClass) { // re-create this config group final Object instance; try { instance = configurationClass.getConstructor().newInstance(); } catch (InstantiationException e) { throw toError(e); } catch (IllegalAccessException e) { throw toError(e); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } catch (NoSuchMethodException e) { throw toError(e); } // the name includes everything up to (but not including) the member key final StringBuilder nameBuilder = new StringBuilder(ni.getAllPreviousSegments()); readConfigGroup(definition, instance, nameBuilder); return instance; } @SuppressWarnings("unchecked") private Map<String, Object> getAsMap(final Map<String, Object> map, final String key) { return (Map<String, Object>) map.get(key); } @SuppressWarnings("unchecked") private Map<String, Object> getFieldAsMap(final Field field, final Object instance) throws IllegalAccessException { return (Map<String, Object>) field.get(instance); } /** * Read a configuration group, recursing into nested groups and instantiating empty maps. * * @param definition the definition of the configuration group * @param instance the group instance * @param nameBuilder the name builder (set to the last segment before the current group's property names) */ private void readConfigGroup(ClassDefinition definition, Object instance, final StringBuilder nameBuilder) { for (ClassDefinition.ClassMember member : definition.getMembers()) { Field field = member.getField(); if (member instanceof ClassDefinition.MapMember) { // get these on the sweep-up try { field.set(instance, new TreeMap<>()); } catch (IllegalAccessException e) { throw toError(e); } continue; } String propertyName = member.getPropertyName(); if (member instanceof ClassDefinition.ItemMember) { ClassDefinition.ItemMember leafMember = (ClassDefinition.ItemMember) member; int len = nameBuilder.length(); try { if (!propertyName.isEmpty()) { nameBuilder.append('.').append(propertyName); } String fullName = nameBuilder.toString(); if (processedNames.add(fullName)) { readConfigValue(fullName, leafMember, instance); } } finally { nameBuilder.setLength(len); } } else { assert member instanceof ClassDefinition.GroupMember; // construct the nested instance ClassDefinition.GroupMember groupMember = (ClassDefinition.GroupMember) member; if (groupMember.isOptional()) { try { field.set(instance, Optional.empty()); } catch (IllegalAccessException e) { throw toError(e); } } else { Class<?> clazz = groupMember.getGroupDefinition().getConfigurationClass(); Object nestedInstance; try { nestedInstance = clazz.getConstructor().newInstance(); } catch (InstantiationException e) { throw toError(e); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } catch (NoSuchMethodException e) { throw toError(e); } catch (IllegalAccessException e) { throw toError(e); } try { field.set(instance, nestedInstance); } catch (IllegalAccessException e) { throw toError(e); } if (propertyName.isEmpty()) { readConfigGroup( groupMember.getGroupDefinition(), nestedInstance, nameBuilder); } else { int len = nameBuilder.length(); try { nameBuilder.append('.').append(propertyName); readConfigGroup( groupMember.getGroupDefinition(), nestedInstance, nameBuilder); } finally { nameBuilder.setLength(len); } } } } } } private void readConfigValue(String fullName, ClassDefinition.ItemMember member, Object instance) { Field field = member.getField(); Converter<?> converter = getConverter(config, field, ConverterType.of(field)); try { Object val = config.getValue(fullName, converter); field.set(instance, val); } catch (IllegalAccessException e) { throw toError(e); } catch (Exception e) { throw new ConfigurationException(e.getMessage(), e, Collections.singleton(fullName)); } } @SuppressWarnings({ "unchecked", "rawtypes" }) private Converter<?> getConverter(SmallRyeConfig config, Field field, ConverterType valueType) { Converter<?> converter = convByType.get(valueType); if (converter != null) { return converter; } if (valueType instanceof ArrayOf) { ArrayOf arrayOf = (ArrayOf) valueType; converter = Converters.newArrayConverter( getConverter(config, field, arrayOf.getElementType()), arrayOf.getArrayType()); } else if (valueType instanceof CollectionOf) { CollectionOf collectionOf = (CollectionOf) valueType; Class<?> collectionClass = collectionOf.getCollectionClass(); final Converter<?> nested = getConverter(config, field, collectionOf.getElementType()); if (collectionClass == List.class) { converter = Converters.newCollectionConverter(nested, ConfigUtils.listFactory()); } else if (collectionClass == Set.class) { converter = Converters.newCollectionConverter(nested, ConfigUtils.setFactory()); } else if (collectionClass == SortedSet.class) { converter = Converters.newCollectionConverter(nested, ConfigUtils.sortedSetFactory()); } else { throw reportError(field, "Unsupported configuration collection type: %s", collectionClass); } } else if (valueType instanceof Leaf) { Leaf leaf = (Leaf) valueType; Class<? extends Converter<?>> convertWith = leaf.getConvertWith(); if (convertWith != null) { try { final Constructor<? extends Converter<?>> ctor; // TODO: temporary until type param inference is in if (convertWith == HyphenateEnumConverter.class.asSubclass(Converter.class)) { ctor = convertWith.getConstructor(Class.class); converter = ctor.newInstance(valueType.getLeafType()); } else { ctor = convertWith.getConstructor(); converter = ctor.newInstance(); } } catch (InstantiationException e) { throw toError(e); } catch (IllegalAccessException e) { throw toError(e); } catch (InvocationTargetException e) { throw unwrapInvocationTargetException(e); } catch (NoSuchMethodException e) { throw toError(e); } } else { converter = config.requireConverter(leaf.getLeafType()); } } else if (valueType instanceof LowerBoundCheckOf) { // todo: add in bounds checker converter = getConverter(config, field, ((LowerBoundCheckOf) valueType).getClassConverterType()); } else if (valueType instanceof UpperBoundCheckOf) { // todo: add in bounds checker converter = getConverter(config, field, ((UpperBoundCheckOf) valueType).getClassConverterType()); } else if (valueType instanceof MinMaxValidated) { MinMaxValidated minMaxValidated = (MinMaxValidated) valueType; String min = minMaxValidated.getMin(); boolean minInclusive = minMaxValidated.isMinInclusive(); String max = minMaxValidated.getMax(); boolean maxInclusive = minMaxValidated.isMaxInclusive(); Converter<?> nestedConverter = getConverter(config, field, minMaxValidated.getNestedType()); if (min != null) { if (max != null) { converter = Converters.rangeValueStringConverter((Converter) nestedConverter, min, minInclusive, max, maxInclusive); } else { converter = Converters.minimumValueStringConverter((Converter) nestedConverter, min, minInclusive); } } else { assert min == null && max != null; converter = Converters.maximumValueStringConverter((Converter) nestedConverter, max, maxInclusive); } } else if (valueType instanceof OptionalOf) { OptionalOf optionalOf = (OptionalOf) valueType; converter = Converters.newOptionalConverter(getConverter(config, field, optionalOf.getNestedType())); } else if (valueType instanceof PatternValidated) { PatternValidated patternValidated = (PatternValidated) valueType; converter = Converters.patternValidatingConverter(getConverter(config, field, patternValidated.getNestedType()), patternValidated.getPatternString()); } else { throw Assert.unreachableCode(); } convByType.put(valueType, converter); return converter; } /** * We collect all properties from eligible ConfigSources, because Config#getPropertyNames exclude the active * profiled properties, meaning that the property is written in the default config source without the profile * prefix. This may cause issues if we run with a different profile and fallback to defaults. * * We also filter the properties coming from the System with the registered roots, because we don't want to * record properties set by the compiling JVM (or other properties that are only related to the build). */ private Set<String> getAllProperties(final Set<String> registeredRoots) { Set<String> properties = new HashSet<>(); for (ConfigSource configSource : config.getConfigSources()) { if (configSource instanceof SysPropConfigSource) { for (String propertyName : configSource.getProperties().keySet()) { NameIterator ni = new NameIterator(propertyName); if (ni.hasNext() && PropertiesUtil.isPropertyInRoot(registeredRoots, ni)) { properties.add(propertyName); } } } else { properties.addAll(configSource.getPropertyNames()); } } for (String propertyName : config.getPropertyNames()) { properties.add(propertyName); } return properties; } /** * Use this Config instance to record the specified runtime default values. We cannot use the main Config * instance because it may record values coming from the EnvSource in build time. Environment variable values * may be completely different between build and runtime, so it doesn't make sense to record these. * * We do exclude the properties coming from the EnvSource, but a call to getValue may still provide a result * coming from the EnvSource, so we need to exclude it from the sources when recording values for runtime. * * We also do not want to completely exclude the EnvSource, because it may provide values for the build. This * is only specific when recording the defaults. * * @return a new SmallRye instance without the EnvSources. */ private SmallRyeConfig getConfigForRuntimeDefaults() { SmallRyeConfigBuilder builder = new SmallRyeConfigBuilder(); builder.withDefaultValue(SMALLRYE_CONFIG_PROFILE, ProfileManager.getActiveProfile()); builder.addDefaultInterceptors(); for (ConfigSource configSource : config.getConfigSources()) { if (configSource instanceof EnvConfigSource) { continue; } builder.withSources(configSource); } return builder.build(); } private void filterActiveProfileProperties(final Map<String, String> properties) { Set<String> propertiesToRemove = new HashSet<>(); for (String property : properties.keySet()) { String profiledProperty = "%" + ProfileManager.getActiveProfile() + "." + property; if (properties.containsKey(profiledProperty)) { propertiesToRemove.add(property); } } properties.keySet().removeAll(propertiesToRemove); } } public static final class ReadResult { final Map<Class<?>, Object> objectsByRootClass; final Map<String, String> specifiedRunTimeDefaultValues; final Map<String, String> buildTimeRunTimeVisibleValues; final Map<String, String> allBuildTimeValues; final ConfigPatternMap<Container> buildTimePatternMap; final ConfigPatternMap<Container> buildTimeRunTimePatternMap; final ConfigPatternMap<Container> bootstrapPatternMap; final ConfigPatternMap<Container> runTimePatternMap; final Map<Class<?>, RootDefinition> runTimeRootsByClass; final List<RootDefinition> allRoots; final boolean bootstrapRootsEmpty; ReadResult(final Map<Class<?>, Object> objectsByRootClass, final Map<String, String> specifiedRunTimeDefaultValues, final Map<String, String> buildTimeRunTimeVisibleValues, Map<String, String> allBuildTimeValues, final ConfigPatternMap<Container> buildTimePatternMap, final ConfigPatternMap<Container> buildTimeRunTimePatternMap, final ConfigPatternMap<Container> bootstrapPatternMap, final ConfigPatternMap<Container> runTimePatternMap, final List<RootDefinition> allRoots, boolean bootstrapRootsEmpty) { this.objectsByRootClass = objectsByRootClass; this.specifiedRunTimeDefaultValues = specifiedRunTimeDefaultValues; this.buildTimeRunTimeVisibleValues = buildTimeRunTimeVisibleValues; this.buildTimePatternMap = buildTimePatternMap; this.buildTimeRunTimePatternMap = buildTimeRunTimePatternMap; this.bootstrapPatternMap = bootstrapPatternMap; this.runTimePatternMap = runTimePatternMap; this.allRoots = allRoots; this.bootstrapRootsEmpty = bootstrapRootsEmpty; this.allBuildTimeValues = allBuildTimeValues; Map<Class<?>, RootDefinition> map = new HashMap<>(); for (RootDefinition root : allRoots) { map.put(root.getConfigurationClass(), root); } runTimeRootsByClass = map; } public Map<Class<?>, Object> getObjectsByRootClass() { return objectsByRootClass; } public Object requireRootObjectForClass(Class<?> clazz) { Object obj = objectsByRootClass.get(clazz); if (obj == null) { throw new IllegalStateException("No root found for " + clazz); } return obj; } public Map<String, String> getSpecifiedRunTimeDefaultValues() { return specifiedRunTimeDefaultValues; } public Map<String, String> getBuildTimeRunTimeVisibleValues() { return buildTimeRunTimeVisibleValues; } public ConfigPatternMap<Container> getBuildTimePatternMap() { return buildTimePatternMap; } public ConfigPatternMap<Container> getBuildTimeRunTimePatternMap() { return buildTimeRunTimePatternMap; } public ConfigPatternMap<Container> getBootstrapPatternMap() { return bootstrapPatternMap; } public ConfigPatternMap<Container> getRunTimePatternMap() { return runTimePatternMap; } public Map<String, String> getAllBuildTimeValues() { return allBuildTimeValues; } public List<RootDefinition> getAllRoots() { return allRoots; } public boolean isBootstrapRootsEmpty() { return bootstrapRootsEmpty; } public RootDefinition requireRootDefinitionForClass(Class<?> clazz) { final RootDefinition def = runTimeRootsByClass.get(clazz); if (def == null) { throw new IllegalStateException("No root definition found for " + clazz); } return def; } } }
package com.arzio.arziolib.api.impl; import java.net.URL; import java.util.logging.Logger; import org.apache.commons.io.IOUtils; import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import com.arzio.arziolib.api.UpdateChecker; /** * Works only for GitHub. */ public class GitHubUpdateChecker implements UpdateChecker { private final String apiURL; private final String pluginPageURL; private String latestVersionTag; private UpdateState state = UpdateState.UP_TO_DATE; private final Plugin plugin; public GitHubUpdateChecker(Plugin plugin, String apiURL, String pluginPageURL) { this.apiURL = apiURL; this.plugin = plugin; this.pluginPageURL = pluginPageURL; } @Override public UpdateState getState() { return this.state; } /** * Gets the latest version previously retrieved from GitHub. In case of * connection errors, it returns the current plugin version. * * @return String with the latest plugin version */ @Override public String getLatestVersionTag() { return this.state == UpdateState.FAILED_TO_CHECK ? this.plugin.getDescription().getVersion() : this.latestVersionTag; } @Override public void checkUpdates(CheckMethod method) { Logger logger = this.plugin.getLogger(); logger.info("Checking for "+plugin.getName()+" updates..."); Runnable runnable = new Runnable() { @Override public void run() { try { JSONArray updates = (JSONArray) new JSONParser().parse(IOUtils.toString(new URL(apiURL))); JSONObject release = (JSONObject) updates.get(0); // Gets the first element of the array (most // updated version) // Updates the latest version tag obtained from GitHub GitHubUpdateChecker.this.latestVersionTag = (String) release.get("tag_name"); boolean isUpToDate = plugin.getDescription().getVersion().equalsIgnoreCase(latestVersionTag); if (isUpToDate) { GitHubUpdateChecker.this.state = UpdateState.UP_TO_DATE; plugin.getLogger().info(plugin.getName()+" is up-to-date!"); } else { GitHubUpdateChecker.this.state = UpdateState.NEEDS_UPDATE; plugin.getLogger().info( "There is a new "+plugin.getName()+" version to download! Download it at "+pluginPageURL); } } catch (Exception e) { GitHubUpdateChecker.this.state = UpdateState.FAILED_TO_CHECK; plugin.getLogger().warning( plugin.getName()+" could not get information about the latest updates. Check your firewall or internet connection!"); e.printStackTrace(); } } }; switch (method) { case ASYNC: Bukkit.getScheduler().runTaskAsynchronously(this.plugin, runnable); break; case SYNC: runnable.run(); break; } } @Override public String getPluginPageURL() { return pluginPageURL; } @Override public String getApiURL() { return apiURL; } @Override public Plugin getPlugin() { return plugin; } }
package com.zendesk.maxwell.schema; /* represents the schema of the `maxwell` databases, and contains code around upgrading * and managing that schema * * TODO: move all this into MysqlSchemaStore */ import java.sql.*; import java.util.HashMap; import java.util.ArrayList; import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import com.zendesk.maxwell.replication.BinlogPosition; import com.zendesk.maxwell.replication.Position; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.zendesk.maxwell.schema.ddl.InvalidSchemaError; public class SchemaStoreSchema { static final Logger LOGGER = LoggerFactory.getLogger(SchemaStoreSchema.class); public static void ensureMaxwellSchema(Connection connection, String schemaDatabaseName) throws SQLException, IOException, InvalidSchemaError { if ( !storeDatabaseExists(connection, schemaDatabaseName) ) { createStoreDatabase(connection, schemaDatabaseName); } } private static boolean storeDatabaseExists(Connection connection, String schemaDatabaseName) throws SQLException { Statement s = connection.createStatement(); ResultSet rs = s.executeQuery("show databases like '" + schemaDatabaseName + "'"); if (!rs.next()) return false; rs = s.executeQuery("show tables from `" + schemaDatabaseName + "` like 'schemas'"); return rs.next(); } private static void executeSQLInputStream(Connection connection, InputStream schemaSQL, String schemaDatabaseName) throws SQLException, IOException { BufferedReader r = new BufferedReader(new InputStreamReader(schemaSQL)); String sql = "", line; if ( schemaDatabaseName != null ) { connection.createStatement().execute("CREATE DATABASE IF NOT EXISTS `" + schemaDatabaseName + "`"); if (!connection.getCatalog().equals(schemaDatabaseName)) connection.setCatalog(schemaDatabaseName); } while ((line = r.readLine()) != null) { sql += line + "\n"; } for (String statement : StringUtils.splitByWholeSeparator(sql, "\n\n")) { if (statement.length() == 0) continue; connection.createStatement().execute(statement); } } private static void createStoreDatabase(Connection connection, String schemaDatabaseName) throws SQLException, IOException { LOGGER.info("Creating " + schemaDatabaseName + " database"); executeSQLInputStream(connection, SchemaStoreSchema.class.getResourceAsStream("/sql/maxwell_schema.sql"), schemaDatabaseName); executeSQLInputStream(connection, SchemaStoreSchema.class.getResourceAsStream("/sql/maxwell_schema_bootstrap.sql"), schemaDatabaseName); executeSQLInputStream(connection, SchemaStoreSchema.class.getResourceAsStream("/sql/maxwell_schema_heartbeats.sql"), schemaDatabaseName); } private static HashMap<String, String> getTableColumns(String table, Connection c) throws SQLException { HashMap<String, String> map = new HashMap<>(); ResultSet rs = c.createStatement().executeQuery("show columns from `" + table + "`"); while (rs.next()) { map.put(rs.getString("Field"), rs.getString("Type")); } return map; } private static ArrayList<String> getMaxwellTables(Connection c) throws SQLException { ArrayList<String> l = new ArrayList<>(); ResultSet rs = c.createStatement().executeQuery("show tables"); while (rs.next()) { l.add(rs.getString(1)); } return l; } private static void performAlter(Connection c, String sql) throws SQLException { LOGGER.info("Maxwell is upgrading its own schema: '" + sql + "'"); c.createStatement().execute(sql); } public static void upgradeSchemaStoreSchema(Connection c) throws SQLException, IOException { ArrayList<String> maxwellTables = getMaxwellTables(c); if ( !getTableColumns("schemas", c).containsKey("deleted") ) { performAlter(c, "alter table `schemas` add column deleted tinyint(1) not null default 0"); } if ( !getTableColumns("schemas", c).containsKey("gtid_set") ) { performAlter(c, "alter table `schemas` add column gtid_set varchar(4096)"); } if ( !maxwellTables.contains("bootstrap") ) { LOGGER.info("adding bootstrap tables to the maxwell schema."); InputStream is = MysqlSavedSchema.class.getResourceAsStream("/sql/maxwell_schema_bootstrap.sql"); executeSQLInputStream(c, is, null); } if ( !getTableColumns("bootstrap", c).containsKey("total_rows") ) { performAlter(c, "alter table `bootstrap` add column total_rows bigint unsigned not null default 0 after inserted_rows"); performAlter(c, "alter table `bootstrap` modify column inserted_rows bigint unsigned not null default 0"); } if ( !getTableColumns("bootstrap", c).containsKey("where_clause") ) { performAlter(c, "alter table `bootstrap` add column where_clause varchar(1024)"); } HashMap<String, String> schemaColumns = getTableColumns("schemas", c); if ( !schemaColumns.containsKey("charset")) { String[] charsetTables = { "schemas", "databases", "tables", "columns" }; for ( String table : charsetTables ) { performAlter(c, "alter table `" + table + "` change `encoding` `charset` varchar(255)"); } } if ( !schemaColumns.containsKey("base_schema_id")) performAlter(c, "alter table `schemas` add column base_schema_id int unsigned NULL default NULL after binlog_position"); if ( !schemaColumns.containsKey("deltas")) performAlter(c, "alter table `schemas` add column deltas mediumtext charset 'utf8' NULL default NULL after base_schema_id"); if ( !schemaColumns.containsKey("version")) { performAlter(c, "alter table `schemas` add column `version` smallint unsigned not null default 0 after `charset`"); } if ( !getTableColumns("positions", c).containsKey("client_id") ) { performAlter(c, "alter table `positions` add column `client_id` varchar(255) charset 'latin1' not null default 'maxwell'"); performAlter(c, "alter table `positions` drop primary key, add primary key(`server_id`, `client_id`)"); } if ( !getTableColumns("positions", c).containsKey("gtid_set") ) { performAlter(c, "alter table `positions` add column gtid_set varchar(4096)"); } if ( !getTableColumns("positions", c).containsKey("heartbeat_at") ) { // Note: unused as of 64a6a30074e3509ed9ed102a149bf5ca844f5df5; will be removed in the future performAlter(c, "alter table `positions` add column `heartbeat_at` bigint null default null"); } if ( !getTableColumns("positions", c).containsKey("last_heartbeat_read") ) { performAlter(c, "alter table `positions` add column `last_heartbeat_read` bigint null default null"); } if ( !getTableColumns("columns", c).containsKey("column_length") ) { performAlter(c, "alter table `columns` add column `column_length` tinyint unsigned"); } if ( !schemaColumns.containsKey("position_sha") ) { performAlter(c, "alter table `schemas` add column `position_sha` char(40) charset 'latin1' null default null, add unique index(`position_sha`)"); backfillPositionSHAs(c); } if ( !maxwellTables.contains("heartbeats") ) { LOGGER.info("adding heartbeats table to the maxwell schema."); InputStream is = MysqlSavedSchema.class.getResourceAsStream("/sql/maxwell_schema_heartbeats.sql"); executeSQLInputStream(c, is, null); } if ( !schemaColumns.containsKey("last_heartbeat_read") ) { // default 0 makes sorting easier (rows before this migration are older than those after) performAlter(c, "alter table `schemas` add column `last_heartbeat_read` bigint null default 0"); } } private static void backfillPositionSHAs(Connection c) throws SQLException { ResultSet rs = c.createStatement().executeQuery("select * from `schemas`"); while (rs.next()) { Long id = rs.getLong("id"); Position position = new Position( new BinlogPosition(rs.getLong("binlog_position"), rs.getString("binlog_file")), rs.getLong("last_heartbeat_read") ); String sha = MysqlSavedSchema.getSchemaPositionSHA(rs.getLong("server_id"), position); c.createStatement().executeUpdate("update `schemas` set `position_sha` = '" + sha + "' where id = " + id); } rs.close(); } }
package com.vincentklim.deck; /** * <description> * * @author Vincent Lim * @version August 02, 2018 */ public class Deck { }
/** * Automatically generated file. DO NOT MODIFY */ package org.nativescript.modal622; public final class BuildConfig { public static final boolean DEBUG = Boolean.parseBoolean("true"); public static final String APPLICATION_ID = "org.nativescript.modal622"; public static final String BUILD_TYPE = "debug"; public static final String FLAVOR = ""; public static final int VERSION_CODE = 10000; public static final String VERSION_NAME = "1.0"; }
/* * Copyright 2012 Red Hat, Inc. and/or its affiliates. * * 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.optaplanner.core.impl.score.director.easy; import org.optaplanner.core.api.domain.solution.PlanningSolution; import org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor; import org.optaplanner.core.impl.score.director.AbstractScoreDirectorFactory; import org.optaplanner.core.impl.score.director.ScoreDirectorFactory; /** * Easy implementation of {@link ScoreDirectorFactory}. * * @param <Solution_> the solution type, the class with the {@link PlanningSolution} annotation * @see EasyScoreDirector * @see ScoreDirectorFactory */ public class EasyScoreDirectorFactory<Solution_> extends AbstractScoreDirectorFactory<Solution_> { private final EasyScoreCalculator<Solution_> easyScoreCalculator; public EasyScoreDirectorFactory(SolutionDescriptor<Solution_> solutionDescriptor, EasyScoreCalculator<Solution_> easyScoreCalculator) { super(solutionDescriptor); this.easyScoreCalculator = easyScoreCalculator; } // ************************************************************************ // Complex methods // ************************************************************************ @Override public EasyScoreDirector<Solution_> buildScoreDirector( boolean lookUpEnabled, boolean constraintMatchEnabledPreference) { return new EasyScoreDirector<>(this, lookUpEnabled, constraintMatchEnabledPreference, easyScoreCalculator); } }
/* * MIT License * * Copyright (c) 2022 MASES s.r.l. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ /************************************************************************************** * <auto-generated> * This code was generated from a template using JCOReflector * * Manual changes to this file may cause unexpected behavior in your application. * Manual changes to this file will be overwritten if the code is regenerated. * </auto-generated> *************************************************************************************/ package system.windows.forms; import org.mases.jcobridge.*; import org.mases.jcobridge.netreflection.*; // Import section import system.windows.forms.FormClosingEventArgs; /** * The Java interface to be implemented to receive events from the CLR using {@link FormClosingEventHandler}. * <p> * * See: <a href="https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Forms.FormClosingEventHandler" target="_top">https://docs.microsoft.com/en-us/dotnet/api/System.Windows.Forms.FormClosingEventHandler</a> */ public interface IFormClosingEventHandler { public void Invoke(NetObject sender, FormClosingEventArgs e); }
/** * */ package pl.projewski.bitcoin.store.json;
package recurssion; import java.util.Scanner; public class AllUniquePathWithObstacle { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- > 0){ int n = sc.nextInt(); int m = sc.nextInt(); int[][] obstacleGrid = new int[n][m]; for(int i = 0; i<n; i++){ for(int j = 0; j<m; j++){ obstacleGrid[i][j] = sc.nextInt(); } } System.out.println(uniquePathsWithObstacles(obstacleGrid)); } } public static int uniquePathsWithObstacles(int[][] obstacleGrid) { int m = obstacleGrid.length; int n = obstacleGrid[0].length; int[][] path = new int[m][n]; if( obstacleGrid[0][0] == 1 ){ return 0; } path[0][0] = 1; for(int i = 1; i<m; i++){ if( obstacleGrid[i][0] == 0 && path[i-1][0] == 1 ){ path[i][0] = 1; }else{ path[i][0] = 0; } } for(int i = 1; i<n; i++){ if( obstacleGrid[0][i] == 0 && path[0][i-1] == 1 ){ path[0][i] = 1; }else{ path[0][i] = 0; } } for(int i = 1; i<m; i++){ for(int j = 1; j<n; j++){ if( obstacleGrid[i][j] == 1) { path[i][j] = 0; }else{ path[i][j] = path[i-1][j] + path[i][j-1]; } } } return path[m-1][n-1]; } }
package com.gi.simpleprograms.concurrency; public class ThreadOne extends Thread { AnObjectClass anObjectClass; public ThreadOne(AnObjectClass anObjectClass) { super(); this.anObjectClass = anObjectClass; } @Override public void run() { // TODO Auto-generated method stub anObjectClass.printSomething(5); } }
/* * Copyright 2018 Karl Dahlgren * * 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.castlemock.web.mock.soap.support; import com.castlemock.core.mock.soap.model.project.domain.SoapOperationIdentifier; import org.junit.Assert; import org.junit.Test; /** * @author Karl Dahlgren * @since 1.35 */ public class SoapUtilityTest { @Test public void testExtractSoapRequestName(){ final String requestBody = "<?xml version=\"1.0\"?>\n" + "<soap:Envelope\n" + "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope/\"\n" + "soap:encodingStyle=\"http://www.w3.org/2003/05/soap-encoding\">\n" + "<soap:Body>\n" + " <m:GetPrice xmlns:m=\"http://www.w3schools.com/prices\">\n" + " <m:Item>Apples</m:Item>\n" + " </m:GetPrice>\n" + "</soap:Body>\n" + "</soap:Envelope> "; final SoapOperationIdentifier operationIdentifier = SoapUtility.extractSoapRequestName(requestBody); Assert.assertEquals("GetPrice", operationIdentifier.getName()); Assert.assertEquals("http://www.w3schools.com/prices", operationIdentifier.getNamespace()); } @Test public void testExtractSoapRequestNameWithoutNamespaces(){ final String requestBody = "<?xml version=\"1.0\"?>\n" + "<soap:Envelope\n" + "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope/\">\n" + "<soap:Body>\n" + " <GetPrice xmlns=\"http://www.w3schools.com/prices\">\n" + " <Item>Apples</Item>\n" + " </GetPrice>\n" + "</soap:Body>\n" + "</soap:Envelope> "; final SoapOperationIdentifier operationIdentifier = SoapUtility.extractSoapRequestName(requestBody); Assert.assertEquals("GetPrice", operationIdentifier.getName()); Assert.assertEquals("http://www.w3schools.com/prices", operationIdentifier.getNamespace()); } @Test public void testExtractSoapRequestNameNamespacesInElement(){ final String requestBody = "<?xml version=\"1.0\"?>\n" + "<soap:Envelope\n" + "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope/\">\n" + "<soap:Body>\n" + " <GetPrice>\n" + " <Item>Apples</Item>\n" + " </GetPrice>\n" + "</soap:Body>\n" + "</soap:Envelope> "; final SoapOperationIdentifier operationIdentifier = SoapUtility.extractSoapRequestName(requestBody); Assert.assertEquals("GetPrice", operationIdentifier.getName()); Assert.assertNull(operationIdentifier.getNamespace()); } @Test public void testExtractSoapSameNamespaceAndName(){ final String requestBody = "<?xml version=\"1.0\"?>\n" + "<soap:Envelope\n" + "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope/\"\n" + "soap:encodingStyle=\"http://www.w3.org/2003/05/soap-encoding\">\n" + "<soap:Body>\n" + " <GetPrice xmlns:GetPrice=\"http://www.w3schools.com/prices\">\n" + " <m:Item>Apples</m:Item>\n" + " </GetPrice>\n" + "</soap:Body>\n" + "</soap:Envelope> "; final SoapOperationIdentifier operationIdentifier = SoapUtility.extractSoapRequestName(requestBody); Assert.assertEquals("GetPrice", operationIdentifier.getName()); Assert.assertNull(operationIdentifier.getNamespace()); } @Test public void testExtractSoapRequestNameWithoutBodyNamespace(){ final String requestBody = "<?xml version=\"1.0\"?>\n" + "<soap:Envelope\n" + "xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope/\">\n" + "<Body>\n" + " <GetPrice>\n" + " <Item>Apples</Item>\n" + " </GetPrice>\n" + "</Body>\n" + "</soap:Envelope> "; final SoapOperationIdentifier operationIdentifier = SoapUtility.extractSoapRequestName(requestBody); Assert.assertEquals("GetPrice", operationIdentifier.getName()); Assert.assertNull(operationIdentifier.getNamespace()); } @Test public void testExtractSoapRequestNameWithoutSoapNamespaces(){ final String requestBody = "<?xml version=\"1.0\"?>\n" + "<Envelope>\n" + "<Body>\n" + " <GetPrice>\n" + " <Item>Apples</Item>\n" + " </GetPrice>\n" + "</Body>\n" + "</Envelope> "; final SoapOperationIdentifier operationIdentifier = SoapUtility.extractSoapRequestName(requestBody); Assert.assertEquals("GetPrice", operationIdentifier.getName()); Assert.assertNull(operationIdentifier.getNamespace()); } @Test(expected = IllegalStateException.class) public void testExtractSoapRequestNameInvalidRequestBody(){ SoapUtility.extractSoapRequestName(new String()); } }
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ package com.facebook.react.turbomodule.core; import androidx.annotation.GuardedBy; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import com.facebook.infer.annotation.Assertions; import com.facebook.jni.HybridData; import com.facebook.proguard.annotations.DoNotStrip; import com.facebook.react.bridge.CxxModuleWrapper; import com.facebook.react.bridge.JSIModule; import com.facebook.react.bridge.RuntimeExecutor; import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.turbomodule.core.interfaces.CallInvokerHolder; import com.facebook.react.turbomodule.core.interfaces.TurboModule; import com.facebook.react.turbomodule.core.interfaces.TurboModuleRegistry; import com.facebook.soloader.SoLoader; import java.util.*; /** * This is the main class and entry point for TurboModules. Note that this is a hybrid class, and * has a C++ counterpart This class installs the JSI bindings. It also implements the method to get * a Java module, that the C++ counterpart calls. */ public class TurboModuleManager implements JSIModule, TurboModuleRegistry { private static volatile boolean sIsSoLibraryLoaded; private final List<String> mEagerInitModuleNames; private final TurboModuleProvider mJavaModuleProvider; private final TurboModuleProvider mCxxModuleProvider; // Prevents the creation of new TurboModules once cleanup as been initiated. private final Object mTurboModuleCleanupLock = new Object(); @GuardedBy("mTurboModuleCleanupLock") private boolean mTurboModuleCleanupStarted = false; // List of TurboModules that have been, or are currently being, instantiated @GuardedBy("mTurboModuleCleanupLock") private final Map<String, TurboModuleHolder> mTurboModuleHolders = new HashMap<>(); @DoNotStrip @SuppressWarnings("unused") private final HybridData mHybridData; public TurboModuleManager( RuntimeExecutor runtimeExecutor, @Nullable final TurboModuleManagerDelegate delegate, CallInvokerHolder jsCallInvokerHolder, CallInvokerHolder nativeCallInvokerHolder) { maybeLoadSoLibrary(); mHybridData = initHybrid( runtimeExecutor, (CallInvokerHolderImpl) jsCallInvokerHolder, (CallInvokerHolderImpl) nativeCallInvokerHolder, delegate, ReactFeatureFlags.useTurboModulesRAIICallbackManager); installJSIBindings(); mEagerInitModuleNames = delegate == null ? new ArrayList<String>() : delegate.getEagerInitModuleNames(); mJavaModuleProvider = new TurboModuleProvider() { @Nullable public TurboModule getModule(String moduleName) { if (delegate == null) { return null; } return delegate.getModule(moduleName); } }; mCxxModuleProvider = new TurboModuleProvider() { @Nullable public TurboModule getModule(String moduleName) { if (delegate == null) { return null; } CxxModuleWrapper nativeModule = delegate.getLegacyCxxModule(moduleName); if (nativeModule != null) { // TurboModuleManagerDelegate must always return TurboModules Assertions.assertCondition( nativeModule instanceof TurboModule, "CxxModuleWrapper \"" + moduleName + "\" is not a TurboModule"); return (TurboModule) nativeModule; } return null; } }; } public List<String> getEagerInitModuleNames() { return mEagerInitModuleNames; } @DoNotStrip @Nullable private CxxModuleWrapper getLegacyCxxModule(String moduleName) { final TurboModule turboModule = getModule(moduleName); if (!(turboModule instanceof CxxModuleWrapper)) { return null; } return (CxxModuleWrapper) turboModule; } @DoNotStrip @Nullable private TurboModule getJavaModule(String moduleName) { final TurboModule turboModule = getModule(moduleName); if (turboModule instanceof CxxModuleWrapper) { return null; } return turboModule; } /** * Return the TurboModule instance that corresponds to the provided moduleName. * * <p>This method: - Creates and initializes the module if it doesn't already exist. - Returns * null after TurboModuleManager has been torn down. */ @Nullable public TurboModule getModule(String moduleName) { TurboModuleHolder moduleHolder; synchronized (mTurboModuleCleanupLock) { if (mTurboModuleCleanupStarted) { /* * Always return null after cleanup has started, so that getModule(moduleName) returns null. */ return null; } /* * TODO(T64619790): Should we populate mJavaTurboModuleHolders ahead of time, to avoid having * * to control concurrent access to it? */ if (!mTurboModuleHolders.containsKey(moduleName)) { mTurboModuleHolders.put(moduleName, new TurboModuleHolder()); } moduleHolder = mTurboModuleHolders.get(moduleName); } TurboModulePerfLogger.moduleCreateStart(moduleName, moduleHolder.getModuleId()); TurboModule module = getModule(moduleName, moduleHolder, true); if (module != null) { TurboModulePerfLogger.moduleCreateEnd(moduleName, moduleHolder.getModuleId()); } else { TurboModulePerfLogger.moduleCreateFail(moduleName, moduleHolder.getModuleId()); } return module; } /** * Given a TurboModuleHolder, and the TurboModule's moduleName, return the TurboModule instance. * * <p>Use the TurboModuleHolder to ensure that if n threads race to create TurboModule x, then * only the first thread creates x. All n - 1 other threads wait until the x is created and * initialized. */ @Nullable private TurboModule getModule( String moduleName, @NonNull TurboModuleHolder moduleHolder, boolean shouldPerfLog) { boolean shouldCreateModule = false; synchronized (moduleHolder) { if (moduleHolder.isDoneCreatingModule()) { if (shouldPerfLog) { TurboModulePerfLogger.moduleCreateCacheHit(moduleName, moduleHolder.getModuleId()); } return moduleHolder.getModule(); } if (!moduleHolder.isCreatingModule()) { // Only one thread gets here shouldCreateModule = true; moduleHolder.startCreatingModule(); } } if (shouldCreateModule) { TurboModulePerfLogger.moduleCreateConstructStart(moduleName, moduleHolder.getModuleId()); TurboModule turboModule = mJavaModuleProvider.getModule(moduleName); if (turboModule == null) { turboModule = mCxxModuleProvider.getModule(moduleName); } TurboModulePerfLogger.moduleCreateConstructEnd(moduleName, moduleHolder.getModuleId()); TurboModulePerfLogger.moduleCreateSetUpStart(moduleName, moduleHolder.getModuleId()); if (turboModule != null) { synchronized (moduleHolder) { moduleHolder.setModule(turboModule); } /* * TurboModuleManager is initialized after ReactApplicationContext has been set up. * NativeModules should be initialized after ReactApplicationContext has been set up. * Therefore, we should initialize on the TurboModule now. */ turboModule.initialize(); } TurboModulePerfLogger.moduleCreateSetUpEnd(moduleName, moduleHolder.getModuleId()); synchronized (moduleHolder) { moduleHolder.endCreatingModule(); moduleHolder.notifyAll(); } return turboModule; } synchronized (moduleHolder) { boolean wasInterrupted = false; while (moduleHolder.isCreatingModule()) { try { // Wait until TurboModule is created and initialized moduleHolder.wait(); } catch (InterruptedException e) { wasInterrupted = true; } } if (wasInterrupted) { /* * TurboModules should ideally be quick to create and initialize. Therefore, * we wait until the TurboModule is done initializing before re-interrupting the * current thread. */ Thread.currentThread().interrupt(); } return moduleHolder.getModule(); } } /** Which TurboModules have been created? */ public Collection<TurboModule> getModules() { final List<TurboModuleHolder> turboModuleHolders = new ArrayList<>(); synchronized (mTurboModuleCleanupLock) { turboModuleHolders.addAll(mTurboModuleHolders.values()); } final List<TurboModule> turboModules = new ArrayList<>(); for (final TurboModuleHolder moduleHolder : turboModuleHolders) { synchronized (moduleHolder) { // No need to wait for the TurboModule to finish being created and initialized if (moduleHolder.getModule() != null) { turboModules.add(moduleHolder.getModule()); } } } return turboModules; } public boolean hasModule(String moduleName) { TurboModuleHolder moduleHolder; synchronized (mTurboModuleCleanupLock) { moduleHolder = mTurboModuleHolders.get(moduleName); } if (moduleHolder != null) { synchronized (moduleHolder) { if (moduleHolder.getModule() != null) { return true; } } } return false; } private native HybridData initHybrid( RuntimeExecutor runtimeExecutor, CallInvokerHolderImpl jsCallInvokerHolder, CallInvokerHolderImpl nativeCallInvokerHolder, TurboModuleManagerDelegate tmmDelegate, boolean useTurboModulesRAIICallbackManager); private native void installJSIBindings(); @Override public void initialize() {} @Override public void onCatalystInstanceDestroy() { /* * Halt the production of new TurboModules. * * <p>After this point, mTurboModuleHolders will not be accessed by TurboModuleManager. * Therefore, it won't be modified. * * <p>The TurboModuleHolders in mTurboModuleHolders, however, can still be populated with newly * created TurboModules. */ synchronized (mTurboModuleCleanupLock) { mTurboModuleCleanupStarted = true; } for (final Map.Entry<String, TurboModuleHolder> moduleHolderEntry : mTurboModuleHolders.entrySet()) { final String moduleName = moduleHolderEntry.getKey(); final TurboModuleHolder moduleHolder = moduleHolderEntry.getValue(); /** * ReactNative could start tearing down before this particular TurboModule has been fully * initialized. In this case, we should wait for initialization to complete, before destroying * the TurboModule. */ final TurboModule turboModule = getModule(moduleName, moduleHolder, false); if (turboModule != null) { turboModule.invalidate(); } } mTurboModuleHolders.clear(); // Delete the native part of this hybrid class. mHybridData.resetNative(); } // Prevents issues with initializer interruptions. See T38996825 and D13793825 for more context. private static synchronized void maybeLoadSoLibrary() { if (!sIsSoLibraryLoaded) { SoLoader.loadLibrary("turbomodulejsijni"); sIsSoLibraryLoaded = true; } } private static class TurboModuleHolder { private volatile TurboModule mModule = null; private volatile boolean mIsTryingToCreate = false; private volatile boolean mIsDoneCreatingModule = false; private static volatile int sHolderCount = 0; private volatile int mModuleId; public TurboModuleHolder() { mModuleId = sHolderCount; sHolderCount += 1; } int getModuleId() { return mModuleId; } void setModule(@NonNull TurboModule module) { mModule = module; } @Nullable TurboModule getModule() { return mModule; } void startCreatingModule() { mIsTryingToCreate = true; } void endCreatingModule() { mIsTryingToCreate = false; mIsDoneCreatingModule = true; } boolean isDoneCreatingModule() { return mIsDoneCreatingModule; } boolean isCreatingModule() { return mIsTryingToCreate; } } private interface TurboModuleProvider { @Nullable TurboModule getModule(String name); } }
package org.deeplearning4j.datasets.iterator.callbacks; import lombok.extern.slf4j.Slf4j; import org.nd4j.linalg.dataset.DataSet; import java.io.File; import java.util.concurrent.atomic.AtomicLong; /** * This callback does DataSet deserialization of a given file. * * @author raver119@gmail.com */ @Slf4j public class DataSetDeserializer implements FileCallback { @Override public <T> T call(File file) { DataSet dataSet = new DataSet(); dataSet.load(file); return (T) dataSet; } }
package edu.gdei.gdeiassistant.Exception.AuthenticationException; /** * 上传的图片不包含身份证信息时,抛出该异常 */ public class NonIDCardInfoException extends Exception { public NonIDCardInfoException() { } public NonIDCardInfoException(String message) { super(message); } }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.team142.gg.server.controller.runnable; import com.team142.gg.server.controller.MessageManager; import com.team142.gg.server.controller.runnable.base.AbstractTickerWorker; import com.team142.gg.server.model.Repository; import com.team142.gg.server.model.messages.outgoing.rendered.MessageShareThingsDynamic; /** * @author just1689 */ public class TickerComms extends AbstractTickerWorker { private long lastPing = 0; public TickerComms(String playerId, String gameId) { super(playerId, gameId); } @Override public void doTick() { checkPing(); MessageManager.sendPlayerAMessage(getPLAYER_ID(), getDynamicThingsMessage()); } private MessageShareThingsDynamic getDynamicThingsMessage() { return new MessageShareThingsDynamic(Repository.GAMES_ON_SERVER.get(getGAME_ID())); } private void checkPing() { if (lastPing == 0) { ping(); } } public void ping() { MessageManager.sendPlayerAMessage(Repository.SESSIONS_ON_SERVER.get(getPLAYER_ID()), "0"); lastPing = System.currentTimeMillis(); } public void pong() { // } }
/*! ****************************************************************************** * * Hop : The Hop Orchestration Platform * * http://www.project-hop.org * ******************************************************************************* * * 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.apache.hop.databases.sqlite; import org.apache.hop.core.database.IDatabase; import org.apache.hop.core.util.Utils; import org.apache.hop.junit.rules.RestoreHopEnvironment; import org.junit.ClassRule; import org.junit.Test; import static org.junit.Assert.*; public class SqliteSequenceAndReleaseSavePointTest { @ClassRule public static RestoreHopEnvironment env = new RestoreHopEnvironment(); final String sequenceName = "sequence_name"; //Set these parameters for the test IDatabase db = new SqliteDatabaseMeta(); Boolean sequenceSupport = false; Boolean savepointSupport = true; @Test public void testSequenceSupport() { assertSupports( db, sequenceSupport ); assertEquals( "", db.getSqlNextSequenceValue( sequenceName ) ); assertEquals( "", db.getSqlCurrentSequenceValue( sequenceName ) ); } @Test public void testSavepointSuport() { if ( savepointSupport ) { assertTrue( db.releaseSavepoint() ); } else { assertFalse( db.releaseSavepoint() ); } } public static void assertSupports( IDatabase db, boolean expected ) { String dbType = db.getClass().getSimpleName(); if ( expected ) { assertTrue( dbType, db.supportsSequences() ); assertFalse( dbType + ": List of Sequences", Utils.isEmpty( db.getSqlListOfSequences() ) ); assertFalse( dbType + ": Sequence Exists", Utils.isEmpty( db.getSqlSequenceExists( "testSeq" ) ) ); assertFalse( dbType + ": Current Value", Utils.isEmpty( db.getSqlCurrentSequenceValue( "testSeq" ) ) ); assertFalse( dbType + ": Next Value", Utils.isEmpty( db.getSqlNextSequenceValue( "testSeq" ) ) ); } else { assertFalse( db.getClass().getSimpleName(), db.supportsSequences() ); assertTrue( dbType + ": List of Sequences", Utils.isEmpty( db.getSqlListOfSequences() ) ); assertTrue( dbType + ": Sequence Exists", Utils.isEmpty( db.getSqlSequenceExists( "testSeq" ) ) ); assertTrue( dbType + ": Current Value", Utils.isEmpty( db.getSqlCurrentSequenceValue( "testSeq" ) ) ); assertTrue( dbType + ": Next Value", Utils.isEmpty( db.getSqlNextSequenceValue( "testSeq" ) ) ); } } }
// ============================================================================ // // Copyright (C) 2006-2021 Talend Inc. - www.talend.com // // This source code is available under agreement available at // %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt // // You should have received a copy of the agreement // along with this program; if not, write to Talend SA // 9 rue Pages 92150 Suresnes, France // // ============================================================================ package org.talend.dataprofiler.help; import org.eclipse.help.ui.internal.IHelpUIConstants; import org.eclipse.help.ui.internal.views.HelpView; @SuppressWarnings("restriction") public class BookmarksHelpView extends HelpView { public static final String HELP_VIEW_ID = "org.talend.dataprofiler.help.BookmarksHelpView"; //$NON-NLS-1$ @Override protected String getFirstPage() { return IHelpUIConstants.HV_BOOKMARKS_PAGE; } public BookmarksHelpView() { } }
/** * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.kafka.clients.consumer; import org.apache.kafka.clients.consumer.internals.NoOpConsumerRebalanceListener; import org.apache.kafka.common.TopicPartition; import org.junit.Test; import java.util.Arrays; import java.util.Iterator; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; public class MockConsumerTest { private MockConsumer<String, String> consumer = new MockConsumer<String, String>(OffsetResetStrategy.EARLIEST); @Test public void testSimpleMock() { consumer.subscribe(Arrays.asList("test"), new NoOpConsumerRebalanceListener()); assertEquals(0, consumer.poll(1000).count()); ConsumerRecord<String, String> rec1 = new ConsumerRecord<String, String>("test", 0, 0, "key1", "value1"); ConsumerRecord<String, String> rec2 = new ConsumerRecord<String, String>("test", 0, 1, "key2", "value2"); consumer.addRecord(rec1); consumer.addRecord(rec2); ConsumerRecords<String, String> recs = consumer.poll(1); Iterator<ConsumerRecord<String, String>> iter = recs.iterator(); assertEquals(rec1, iter.next()); assertEquals(rec2, iter.next()); assertFalse(iter.hasNext()); assertEquals(1L, consumer.position(new TopicPartition("test", 0))); consumer.commitSync(); assertEquals(1L, consumer.committed(new TopicPartition("test", 0)).offset()); } }
package io.github.quickmsg.core.http.model; import lombok.Data; /** * @author luxurong */ @Data public class LoginDo { private String username; private String password; }
package io.onedev.server.util.jetty; import java.net.URL; import org.slf4j.Logger; import org.slf4j.LoggerFactory; /** * This servlet serves static web assets from classpath. * * @author robin * */ public class ClasspathAssetServlet extends AssetServlet { private static final long serialVersionUID = 1L; private final Class<?> packageLocator; private static final Logger logger = LoggerFactory.getLogger(ClasspathAssetServlet.class); /** * Construct a classpath asset servlet using specified package locator. * * @param packageLocator * Asset will be loaded from the package containing the locator class. Asset will be * searched in this package and sub packages recursively. */ public ClasspathAssetServlet(Class<?> packageLocator) { this.packageLocator = packageLocator; } @Override protected URL loadResource(String relativePath) { if (logger.isTraceEnabled()) { logger.trace("Loading classpath resource '{}' from package '{}'...", relativePath, packageLocator.getPackage().getName()); } return packageLocator.getResource(relativePath); } }
package net.wolfesoftware.jax.semalysis; import net.wolfesoftware.jax.ast.Modifier; public class Method extends TakesArguments { public String name; public short modifiers; public Method(Type declaringType, Type returnType, String name, Type[] argumentSignature, short modifiers) { super(declaringType, argumentSignature, returnType); this.name = name; this.modifiers = modifiers; } @Override public String getMethodCode() { return declaringType.getTypeName() + '/' + name + getDescriptor(); } @Override public String getName() { return name; } public static Method getMethod(java.lang.reflect.Method method) { // this lies about the flags in getFlags() but that's fine because we don't ever need them for runtime methods Type declaringClass = RuntimeType.getType(method.getDeclaringClass()); Type returnType = RuntimeType.getType(method.getReturnType()); Type[] argumentSignature = RuntimeType.getTypes(method.getParameterTypes()); return new Method(declaringClass, returnType, method.getName(), argumentSignature, (short)method.getModifiers()); } public static final Method UNKNOWN = new Method(UnknownType.INSTANCE, UnknownType.INSTANCE, "", new Type[0], (short)0); public boolean isPrivate() { return (modifiers & Modifier.ACC_PRIVATE) != 0; } public boolean isStatic() { return (modifiers & Modifier.ACC_STATIC) != 0; } }
package cmps252.HW4_2.UnitTesting; import static org.junit.jupiter.api.Assertions.*; import java.io.FileNotFoundException; import java.util.List; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; import cmps252.HW4_2.Customer; import cmps252.HW4_2.FileParser; @Tag("31") class Record_65 { private static List<Customer> customers; @BeforeAll public static void init() throws FileNotFoundException { customers = FileParser.getCustomers(Configuration.CSV_File); } @Test @DisplayName("Record 65: FirstName is Toby") void FirstNameOfRecord65() { assertEquals("Toby", customers.get(64).getFirstName()); } @Test @DisplayName("Record 65: LastName is Blazina") void LastNameOfRecord65() { assertEquals("Blazina", customers.get(64).getLastName()); } @Test @DisplayName("Record 65: Company is Wharfside Brokerage Co Inc") void CompanyOfRecord65() { assertEquals("Wharfside Brokerage Co Inc", customers.get(64).getCompany()); } @Test @DisplayName("Record 65: Address is 210 S 4th Ave") void AddressOfRecord65() { assertEquals("210 S 4th Ave", customers.get(64).getAddress()); } @Test @DisplayName("Record 65: City is Mount Vernon") void CityOfRecord65() { assertEquals("Mount Vernon", customers.get(64).getCity()); } @Test @DisplayName("Record 65: County is Westchester") void CountyOfRecord65() { assertEquals("Westchester", customers.get(64).getCounty()); } @Test @DisplayName("Record 65: State is NY") void StateOfRecord65() { assertEquals("NY", customers.get(64).getState()); } @Test @DisplayName("Record 65: ZIP is 10550") void ZIPOfRecord65() { assertEquals("10550", customers.get(64).getZIP()); } @Test @DisplayName("Record 65: Phone is 914-771-2679") void PhoneOfRecord65() { assertEquals("914-771-2679", customers.get(64).getPhone()); } @Test @DisplayName("Record 65: Fax is 914-771-5884") void FaxOfRecord65() { assertEquals("914-771-5884", customers.get(64).getFax()); } @Test @DisplayName("Record 65: Email is toby@blazina.com") void EmailOfRecord65() { assertEquals("toby@blazina.com", customers.get(64).getEmail()); } @Test @DisplayName("Record 65: Web is http://www.tobyblazina.com") void WebOfRecord65() { assertEquals("http://www.tobyblazina.com", customers.get(64).getWeb()); } }
package libra.Commands.Moderation; import libra.Config.Config; import libra.Database.Database; import libra.Utils.Command.Command; import net.dv8tion.jda.api.Permission; import net.dv8tion.jda.api.entities.User; import net.dv8tion.jda.api.events.interaction.SlashCommandEvent; import net.dv8tion.jda.api.interactions.commands.OptionMapping; import net.dv8tion.jda.api.interactions.commands.OptionType; import net.dv8tion.jda.api.interactions.commands.build.CommandData; import net.dv8tion.jda.api.interactions.commands.build.OptionData; import org.bson.Document; import java.util.ArrayList; import java.util.List; public class DelInfr implements Command { @Override public void run(SlashCommandEvent context, Document Guild, Config config) { if (context.getMember() == null || context.getGuild() == null) return; if (!context.getMember().hasPermission(Permission.MANAGE_SERVER)) { context.reply(config.getEmojis().Error + "No tienes permisos para ejecutar este comando").setEphemeral(true).queue(); return; } OptionMapping UserOption = context.getOption("usuario"); OptionMapping IDOption = context.getOption("id"); if (UserOption == null) { context.reply(config.getEmojis().Error + "Debes especificar un usuario!").setEphemeral(true).queue(); return; } if (IDOption == null) { context.reply(config.getEmojis().Error + "Debes especificar una ID!").setEphemeral(true).queue(); return; } User User = UserOption.getAsUser(); long ID = IDOption.getAsLong(); List<Document> allInfractions = Database.getInfractionsByID(User.getId(), context.getGuild().getId()).into(new ArrayList<>()); if (allInfractions.isEmpty()) { context.reply(config.getEmojis().Error + "El usuario no tiene infracciones").setEphemeral(true).queue(); return; } Document Infraction = Database.getDatabase().getCollection("Infracciones").find(new Document("GuildID", context.getGuild().getId()).append("UserID", User.getId()).append("ID", ID)).first(); if (Infraction == null) { context.reply(config.getEmojis().Error + "No se ha encontrado la infracción con ID `"+ID+"` del usuario "+User.getAsMention()).setEphemeral(true).queue(); return; } Database.getDatabase().getCollection("Infracciones").deleteOne(new Document("GuildID", context.getGuild().getId()).append("UserID", User.getId()).append("ID", ID)); context.reply(config.getEmojis().Success + "Se ha borrado la infracción con ID `"+ID+"` del usuario "+User.getAsMention()).setEphemeral(false).queue(); } @Override public String getName() { return "delinfr"; } @Override public String getDescription() { return "Borra una infracción de un usuario"; } @Override public String getUsage() { return "delinfr <Usuario> <ID Infraccion>"; } @Override public String getPermissions() { return "Gestionar servidor"; } @Override public String getCategory() { return "Moderación"; } @Override public CommandData getSlashData() { return new CommandData(this.getName(), this.getDescription()) .addOptions(new OptionData(OptionType.USER, "usuario", "Usuario para para su infracción", true), new OptionData(OptionType.INTEGER, "id", "ID de la infracción", true)); } }
package voogasalad.gameauthoringenvironment.gui.levelconfig.nodes; import javafx.scene.control.TextField; public class NumberTextField extends TextField { public NumberTextField(){ this.setPrefWidth(40); } }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package DiagramaFlujo; import java.awt.Color; import javax.swing.JTextField; /** * * @author Arles Cerrato */ public class Lea extends javax.swing.JPanel { //Atributos personalizados private boolean mover = true; private final String nombre = "Lea"; private boolean click; private int x; private int y; private boolean seleccion = false; private boolean seleccionTexto = false; private int altura=44; private int anchura=122; //Constructor public Lea() { initComponents(); this.setBackground(Color.blue); } //Mutadores public boolean isSeleccion() { return seleccion; } public void setSeleccion(boolean seleccion) { this.seleccion = seleccion; } public boolean isSeleccionTexto() { return seleccionTexto; } public void setSeleccionTexto(boolean seleccionTexto) { this.seleccionTexto = seleccionTexto; } public JTextField getTf_lea() { return tf_lea; } public void setTf_lea(JTextField tf_lea) { this.tf_lea = tf_lea; } public String getNombre (){ return nombre; } public boolean isMover() { return mover; } public void setMover(boolean mover) { this.mover = mover; } public int getAltura() { return altura; } public int getAnchura() { return anchura; } /** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor. */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { lb_lea = new javax.swing.JLabel(); tf_lea = new javax.swing.JTextField(); addMouseMotionListener(new java.awt.event.MouseMotionAdapter() { public void mouseDragged(java.awt.event.MouseEvent evt) { formMouseDragged(evt); } }); addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { formMouseClicked(evt); } public void mousePressed(java.awt.event.MouseEvent evt) { formMousePressed(evt); } public void mouseReleased(java.awt.event.MouseEvent evt) { formMouseReleased(evt); } }); lb_lea.setText("LEA"); tf_lea.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { tf_leaMouseClicked(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(lb_lea) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(tf_lea, javax.swing.GroupLayout.PREFERRED_SIZE, 82, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(10, 10, 10) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(lb_lea) .addComponent(tf_lea, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); }// </editor-fold>//GEN-END:initComponents private void formMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMousePressed // TODO add your handling code here: click = true; x = evt.getX(); y = evt.getY(); }//GEN-LAST:event_formMousePressed private void formMouseReleased(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseReleased // TODO add your handling code here: click = false; }//GEN-LAST:event_formMouseReleased private void formMouseDragged(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseDragged // TODO add your handling code here: int x2 = this.getX(); int y2 = this.getY(); if (click && mover) { x2 += evt.getX()-x; y2 += evt.getY()-y; this.setLocation(x2, y2); } }//GEN-LAST:event_formMouseDragged private void formMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_formMouseClicked // TODO add your handling code here: seleccion = true; }//GEN-LAST:event_formMouseClicked private void tf_leaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tf_leaMouseClicked // TODO add your handling code here: seleccionTexto = true; }//GEN-LAST:event_tf_leaMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel lb_lea; private javax.swing.JTextField tf_lea; // End of variables declaration//GEN-END:variables }
package com.vmware.vim25; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlSeeAlso; import javax.xml.bind.annotation.XmlType; /** * <p>Java class for CustomizationIpV6Generator complex type. * * <p>The following schema fragment specifies the expected content contained within this class. * * <pre> * &lt;complexType name="CustomizationIpV6Generator"> * &lt;complexContent> * &lt;extension base="{urn:vim25}DynamicData"> * &lt;sequence> * &lt;/sequence> * &lt;/extension> * &lt;/complexContent> * &lt;/complexType> * </pre> * * */ @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "CustomizationIpV6Generator") @XmlSeeAlso({ CustomizationCustomIpV6Generator.class, CustomizationStatelessIpV6Generator.class, CustomizationUnknownIpV6Generator.class, CustomizationFixedIpV6 .class, CustomizationDhcpIpV6Generator.class, CustomizationAutoIpV6Generator.class }) public class CustomizationIpV6Generator extends DynamicData { }
/* * Apache Fineract * Apache Fineract is a secure, multi-tenanted microfinance platform The goal of the Apache Fineract API is to empower developers to build apps on top of the Apache Fineract Platform<br>The [reference app](https://cui.fineract.dev) (username: mifos, password: password) works on the same demo tenant as the interactive links in this documentation - The API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) - Find out more about Apache Fineract [here](/fineract-provider/api-docs/apiLive.htm#top) - You can [Try The API From Your Browser](/fineract-provider/api-docs/apiLive.htm#interact) - The Generic Options are available [here](/fineract-provider/api-docs/apiLive.htm#genopts) - Find out more about [Updating Dates and Numbers](/fineract-provider/api-docs/apiLive.htm#dates_and_numbers) - For the Authentication and the Basic of HTTP and HTTPS refer [here](/fineract-provider/api-docs/apiLive.htm#authentication_overview) - Check about ERROR codes [here](/fineract-provider/api-docs/apiLive.htm#errors) Please refer to the [old documentation](/fineract-provider/api-docs/apiLive.htm) for any documentation queries * * OpenAPI spec version: 1.3.0-806-gcdf3c76-dirty * Contact: dev@fineract.apache.org * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package org.apache.fineract.client.models; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import io.swagger.v3.oas.annotations.media.Schema; import java.io.IOException; /** * PostLoansLoanIdResponse */ @Schema(description = "PostLoansLoanIdResponse") public class PostLoansLoanIdResponse { @SerializedName("officeId") private Integer officeId = null; @SerializedName("clientId") private Integer clientId = null; @SerializedName("loanId") private Integer loanId = null; @SerializedName("resourceId") private Integer resourceId = null; public PostLoansLoanIdResponse officeId(Integer officeId) { this.officeId = officeId; return this; } /** * Get officeId * @return officeId **/ @Schema(example = "2", description = "") public Integer getOfficeId() { return officeId; } public void setOfficeId(Integer officeId) { this.officeId = officeId; } public PostLoansLoanIdResponse clientId(Integer clientId) { this.clientId = clientId; return this; } /** * Get clientId * @return clientId **/ @Schema(example = "6", description = "") public Integer getClientId() { return clientId; } public void setClientId(Integer clientId) { this.clientId = clientId; } public PostLoansLoanIdResponse loanId(Integer loanId) { this.loanId = loanId; return this; } /** * Get loanId * @return loanId **/ @Schema(example = "3", description = "") public Integer getLoanId() { return loanId; } public void setLoanId(Integer loanId) { this.loanId = loanId; } public PostLoansLoanIdResponse resourceId(Integer resourceId) { this.resourceId = resourceId; return this; } /** * Get resourceId * @return resourceId **/ @Schema(example = "3", description = "") public Integer getResourceId() { return resourceId; } public void setResourceId(Integer resourceId) { this.resourceId = resourceId; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PostLoansLoanIdResponse postLoansLoanIdResponse = (PostLoansLoanIdResponse) o; return Objects.equals(this.officeId, postLoansLoanIdResponse.officeId) && Objects.equals(this.clientId, postLoansLoanIdResponse.clientId) && Objects.equals(this.loanId, postLoansLoanIdResponse.loanId) && Objects.equals(this.resourceId, postLoansLoanIdResponse.resourceId); } @Override public int hashCode() { return Objects.hash(officeId, clientId, loanId, resourceId); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class PostLoansLoanIdResponse {\n"); sb.append(" officeId: ").append(toIndentedString(officeId)).append("\n"); sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); sb.append(" loanId: ").append(toIndentedString(loanId)).append("\n"); sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
package net.booru.adventofcode2017; class Day10 { // this is really quick and dirty, terrible code, and mutable *ugh* static void run() { test(); int value = part1(makeInputArray(256), 106,16,254,226,55,2,1,166,177,247,93,0,255,228,60,36); System.out.println("part1: " + value); } private static int part1(final int[] numbers, int... lengths) { int currentPosition = 0, skipSize = 0; for (int length : lengths) { reverseSubArray(numbers, length, currentPosition); currentPosition = (currentPosition + length + skipSize) % numbers.length; skipSize++; } return numbers[0] * numbers[1]; } private static void reverseSubArray(final int[] numbers, final int length, final int fromIndex) { if (length <= 1) { return; } final int half = length / 2; for (int i = 0; i < half; i++) { final int indexFromLeft = (fromIndex + i) % numbers.length; final int indexFromRight = (fromIndex + length - 1 - i) % numbers.length; final int tmp = numbers[indexFromLeft]; numbers[indexFromLeft] = numbers[indexFromRight]; numbers[indexFromRight] = tmp; } } private static int[] makeInputArray(final int size) { int[] numbers = new int[size]; for (int i = 0; i < size; i++) { numbers[i] = i; } return numbers; } //-------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------- private static void test() { Util.require(part1(makeInputArray(5), 3, 4, 1, 5), 12); System.out.println("All tests ok"); } }
package top.woilanlan.polymorphism.test; import org.junit.Test; import top.woilanlan.polymorphism.CovariantReturn; import top.woilanlan.polymorphism.FieldAccess; import top.woilanlan.polymorphism.Frog; import top.woilanlan.polymorphism.PolyConstructors; import top.woilanlan.polymorphism.PrivateOverride; import top.woilanlan.polymorphism.RTTI; import top.woilanlan.polymorphism.ReferenceCounting; import top.woilanlan.polymorphism.Sandwich; import top.woilanlan.polymorphism.StaticPolymorphism; import top.woilanlan.polymorphism.Transmogrify; import top.woilanlan.polymorphism.music.*; import top.woilanlan.polymorphism.music3.Music3; import top.woilanlan.polymorphism.shape.Shapes; /** * 多态:也称动态绑定 */ public class AllTest { @Test public void test1() { Music.show(); } @Test public void test2() { Music2.show(); } @Test public void test3() { Shapes.show(); } @Test public void test4() { Music3.show(); } @Test public void test5() { PrivateOverride.show(); } @Test public void test6() { FieldAccess.show(); } @Test public void test7() { StaticPolymorphism.show(); } @Test public void test8() { Sandwich.show(); } @Test public void test9() { Frog.show(); } @Test public void test10() { ReferenceCounting.show(); } @Test public void test11() { PolyConstructors.show(); } @Test public void test12() { CovariantReturn.show(); } @Test public void test13() { Transmogrify.show(); } @Test public void test14() { RTTI.show(); } }
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package org.jetbrains.idea.svn.branchConfig; import com.intellij.openapi.components.PersistentStateComponent; import com.intellij.openapi.components.ServiceManager; import com.intellij.openapi.components.State; import com.intellij.openapi.components.Storage; import com.intellij.openapi.project.Project; import com.intellij.openapi.vfs.VirtualFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.idea.svn.api.Url; import java.io.File; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; /** * Holds what working copies we have for URLs */ @State(name = "SvnBranchMapperManager", storages = @Storage("other.xml")) public class SvnBranchMapperManager implements PersistentStateComponent<SvnBranchMapperManager.SvnBranchMapperHolder> { private SvnBranchMapperHolder myStateHolder; public static SvnBranchMapperManager getInstance() { return ServiceManager.getService(SvnBranchMapperManager.class); } public SvnBranchMapperManager() { myStateHolder = new SvnBranchMapperHolder(); } @Override public SvnBranchMapperHolder getState() { return myStateHolder; } @Override public void loadState(@NotNull final SvnBranchMapperHolder state) { myStateHolder = state; } public void put(@NotNull Url url, @NotNull File file) { myStateHolder.put(url.toDecodedString(), file.getAbsolutePath()); } public void remove(@NotNull Url url, @NotNull File value) { Set<String> set = myStateHolder.get(url.toDecodedString()); if (set != null) { set.remove(value.getAbsolutePath()); } } public void notifyBranchesChanged(final Project project, final VirtualFile vcsRoot, final SvnBranchConfigurationNew configuration) { for (Map.Entry<Url, File> entry : configuration.getUrl2FileMappings(project, vcsRoot).entrySet()) { put(entry.getKey(), entry.getValue()); } } public Set<String> get(@NotNull Url url) { return myStateHolder.get(url.toDecodedString()); } public static class SvnBranchMapperHolder { public Map<String, Set<String>> myMapping; public SvnBranchMapperHolder() { myMapping = new HashMap<>(); } public void put(final String key, final String value) { Set<String> files = myMapping.get(key); if (files == null) { files = new HashSet<>(); myMapping.put(key, files); } files.add(value); } public Set<String> get(final String key) { return myMapping.get(key); } } }
/* * Copyright 2018-2020 The Code Department. * * 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.tcdng.unify.web.ui.widget.container; import com.tcdng.unify.core.annotation.Component; import com.tcdng.unify.core.annotation.Configurable; import com.tcdng.unify.web.ui.widget.AbstractDocument; /** * Basic document. * * @author Lateef Ojulari * @since 1.0 */ @Component("ui-document") public class BasicDocument extends AbstractDocument { @Configurable private String[] meta; public void setMeta(String[] meta) { this.meta = meta; } public String[] getMeta() { return meta; } }
package mapsoft.com.costomtopbar.service.socket.update; import android.content.Context; import android.content.pm.PackageInfo; import android.content.pm.PackageManager; /** * @author: vision * @function: * @date: 16/8/16 */ public class Util { public static int getVersionCode(Context context) { int versionCode = 1; try { PackageManager pm = context.getPackageManager(); PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0); versionCode = pi.versionCode; } catch (Exception e) { e.printStackTrace(); } return versionCode; } public static String getVersionName(Context context) { String versionName = "1.0.0"; try { PackageManager pm = context.getPackageManager(); PackageInfo pi = pm.getPackageInfo(context.getPackageName(), 0); versionName = pi.versionName; } catch (Exception e) { e.printStackTrace(); } return versionName; } }
package txtfnnl.pipelines; import java.io.File; import java.io.IOException; import java.util.logging.Logger; import org.apache.commons.cli.CommandLine; import org.apache.commons.cli.CommandLineParser; import org.apache.commons.cli.Options; import org.apache.commons.cli.ParseException; import org.apache.commons.cli.PosixParser; import org.apache.uima.UIMAException; import txtfnnl.uima.analysis_component.BioLemmatizerAnnotator; import txtfnnl.uima.analysis_component.GeneAnnotator; import txtfnnl.uima.analysis_component.GeniaTaggerAnnotator; import txtfnnl.uima.analysis_component.NOOPAnnotator; import txtfnnl.uima.analysis_component.opennlp.TokenAnnotator; import txtfnnl.uima.collection.AnnotationLineWriter; import txtfnnl.uima.collection.OutputWriter; import txtfnnl.uima.collection.TaggedSentenceLineWriter; import txtfnnl.uima.collection.XmiWriter; /** * A plaintext tagger for (nearly arbitrary) input files to annotate entities. * * @author Florian Leitner */ public class EntityTagger extends Pipeline { private EntityTagger() { throw new AssertionError("n/a"); } public static void main(String[] arguments) { final CommandLineParser parser = new PosixParser(); final Options opts = new Options(); CommandLine cmd = null; Pipeline.addLogHelpAndInputOptions(opts); Pipeline.addTikaOptions(opts); Pipeline.addOutputOptions(opts); // sentence splitter options Pipeline.addSentenceAnnotatorOptions(opts); // tokenizer options setup opts.addOption("G", "genia", true, "use GENIA (with the dir containing 'morphdic/') instead of OpenNLP"); try { cmd = parser.parse(opts, arguments); } catch (final ParseException e) { System.err.println(e.getLocalizedMessage()); System.exit(1); // == EXIT == } final Logger l = Pipeline.loggingSetup(cmd, opts, "txtfnnl tag [options] <directory|files...>\n"); // (GENIA) tokenizer final String geniaDir = cmd.getOptionValue('G'); // output (format) OutputWriter.Builder writer; if (Pipeline.rawXmi(cmd)) { writer = Pipeline.configureWriter(cmd, XmiWriter.configure(Pipeline.ensureOutputDirectory(cmd))); } else { // TODO: namespace used by alternate, non-GENIA entity tagger String namespace = cmd.hasOption('G') ? GeniaTaggerAnnotator.ENTITY_NAMESPACE : null; writer = Pipeline.configureWriter(cmd, AnnotationLineWriter.configure()) .setAnnotatorUri(GeniaTaggerAnnotator.URI) .setAnnotationNamespace(namespace); } try { final Pipeline tagger = new Pipeline(4); // tika, splitter, tokenizer, entity tagger tagger.setReader(cmd); tagger.configureTika(cmd); tagger.set(1, Pipeline.textEngine(Pipeline.getSentenceAnnotator(cmd))); if (geniaDir == null) { tagger.set(2, Pipeline.textEngine(TokenAnnotator.configure().create())); // TODO: initialize an alternate, non-GENIA entity tagger throw new RuntimeException("TODO: add another entity tagger apart from GENIA"); } else { GeniaTaggerAnnotator.Builder genia = GeniaTaggerAnnotator.configure(); tagger.set(2, Pipeline.textEngine(genia.setDirectory(new File(geniaDir)).create())); // the GENIA Tagger already tags entities - nothing more to do tagger.set(3, Pipeline.multiviewEngine(NOOPAnnotator.configure().create())); } tagger.setConsumer(Pipeline.textEngine(writer.create())); tagger.run(); tagger.destroy(); } catch (final UIMAException e) { l.severe(e.toString()); System.err.println(e.getLocalizedMessage()); System.exit(1); // == EXIT == } catch (final IOException e) { l.severe(e.toString()); System.err.println(e.getLocalizedMessage()); System.exit(1); // == EXIT == } System.exit(0); } }
package com.microsoft.bingads.v10.api.test.entities.budget.write; import com.microsoft.bingads.v10.api.test.entities.budget.BulkBudgetTest; import com.microsoft.bingads.v10.bulk.entities.BulkBudget; import com.microsoft.bingads.internal.functionalinterfaces.BiConsumer; import java.util.Arrays; import java.util.Collection; import org.junit.Test; import org.junit.runners.Parameterized.Parameter; import org.junit.runners.Parameterized.Parameters; public class BulkBudgetWriteToRowValuesParentIdTest extends BulkBudgetTest { @Parameter(value = 1) public Long propertyValue; @Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {"123", 123L}, {"9223372036854775807", 9223372036854775807L},}); } @Test public void testWrite() { this.<Long>testWriteProperty("Parent Id", this.datum, this.propertyValue, new BiConsumer<BulkBudget, Long>() { @Override public void accept(BulkBudget c, Long v) { c.setAccountId(v); } }); } }
package com.example.ggxiaozhi.italker; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ArgbEvaluator; import android.animation.ObjectAnimator; import android.animation.ValueAnimator; import android.graphics.drawable.ColorDrawable; import android.text.TextUtils; import android.util.Log; import android.util.Property; import android.view.View; import com.example.ggxiaozhi.common.app.Activity; import com.example.ggxiaozhi.common.app.BaseActivity; import com.example.ggxiaozhi.factory.Factory; import com.example.ggxiaozhi.factory.data.helper.MessageHelper; import com.example.ggxiaozhi.factory.presistance.Account; import com.example.ggxiaozhi.italker.activity.AccountActivity; import com.example.ggxiaozhi.italker.activity.MainActivity; import com.example.ggxiaozhi.italker.fragment.assist.PermissionsFragment; import net.qiujuer.genius.res.Resource; import net.qiujuer.genius.ui.compat.UiCompat; public class LaunchActivity extends BaseActivity { private ColorDrawable mBgDrawable;//背景颜色的Drawable @Override protected int getContentLayoutId() { return R.layout.activity_launch; } @Override protected void initWidget() { super.initWidget(); //拿到根布局 View root = findViewById(R.id.activity_launch); //获取颜色 int color = UiCompat.getColor(getResources(), R.color.colorPrimary); //创建一个ColorDrawable ColorDrawable colorDrawable = new ColorDrawable(color); //设置给背景 root.setBackground(colorDrawable); mBgDrawable = colorDrawable; } @Override protected void initData() { super.initData(); //当动画进行到50%的时候获取PushI0d startAnimator(0.5f, new Runnable() { @Override public void run() { //获取绑定的Id waitPushIdRecevierId(); } }); } /** * 等待个推框架给我们的PushId设置好值 */ private void waitPushIdRecevierId() { if (Account.isLogin()) {//已经登录 //已经登录的情况下 判断是否绑定 //如果没有绑定则等待广播接收器进行绑定 if (Account.isBind()) { skip(); return; } } else {//没有登录 //如果拿到PushId 没有登录是不能绑定PushId的 if (!TextUtils.isEmpty(Account.getPushId())) { skip(); return; } } //循环等待 每隔0.5s执行一次本方法 直到获取成功 getWindow().getDecorView().postDelayed(new Runnable() { @Override public void run() { waitPushIdRecevierId(); } }, 500); } /** * 进行剩下的50%动画 完成后跳转 */ private void skip() { //进行剩下的50%动画 startAnimator(1f, new Runnable() { @Override public void run() { realSkip(); } }); } /** * 真正的跳转页面 */ public void realSkip() { //检测权限 if (PermissionsFragment.haveAllPerms(this, getSupportFragmentManager())) { if (Account.isLogin()) { MainActivity.show(this); } else { AccountActivity.show(this); } finish(); } } private void startAnimator(float endProgress, final Runnable callback) { //获取一个最终的颜色 int finalColor = Resource.Color.WHITE;//等价于UiCompat.getColor(getResources(), R.color.colorPrimary); //运算当前进度的颜色(颜色变换计算器) ArgbEvaluator evaluator = new ArgbEvaluator(); int endColor = (int) evaluator.evaluate(endProgress, mBgDrawable.getColor(), finalColor); ValueAnimator animator = ObjectAnimator.ofObject(this, mProperty, evaluator, endColor); animator.setDuration(1500); animator.setIntValues(mBgDrawable.getColor(), endColor);//开始结束的颜色值 animator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); //结束时的触发 callback.run(); } }); animator.start(); } Property<LaunchActivity, Object> mProperty = new Property<LaunchActivity, Object>(Object.class, "color") { @Override public Object get(LaunchActivity object) { return object.mBgDrawable.getColor(); } @Override public void set(LaunchActivity object, Object value) { object.mBgDrawable.setColor((Integer) value); } }; }
/* * Copyright 2015, The Querydsl Team (http://www.querydsl.com/team) * * 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.querydsl.core.alias; import java.lang.reflect.Array; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; import java.math.BigDecimal; import java.math.BigInteger; import java.sql.Timestamp; import java.util.Arrays; import java.util.Date; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.jetbrains.annotations.Nullable; import com.querydsl.core.types.*; import com.querydsl.core.util.BeanUtils; import com.querydsl.core.util.ReflectionUtils; import net.sf.cglib.proxy.MethodInterceptor; import net.sf.cglib.proxy.MethodProxy; /** * {@code PropertyAccessInvocationHandler} is the main InvocationHandler class for the * CGLIB alias proxies * * @author tiwe */ class PropertyAccessInvocationHandler implements MethodInterceptor { private static final int RETURN_VALUE = 42; private final Expression<?> hostExpression; private final AliasFactory aliasFactory; private final Map<Object, Expression<?>> propToExpr = new ConcurrentHashMap<>(); private final Map<Object, Object> propToObj = new ConcurrentHashMap<>(); private final PathFactory pathFactory; private final TypeSystem typeSystem; public PropertyAccessInvocationHandler(Expression<?> host, AliasFactory aliasFactory, PathFactory pathFactory, TypeSystem typeSystem) { this.hostExpression = host; this.aliasFactory = aliasFactory; this.pathFactory = pathFactory; this.typeSystem = typeSystem; } //CHECKSTYLE:OFF @Override public Object intercept(Object proxy, Method method, Object[] args, MethodProxy methodProxy) throws Throwable { //CHECKSTYLE:ON Object rv = null; MethodType methodType = MethodType.get(method); if (methodType == MethodType.GETTER) { String ptyName = propertyNameForGetter(method); Class<?> ptyClass = method.getReturnType(); Type genericType = method.getGenericReturnType(); if (propToObj.containsKey(ptyName)) { rv = propToObj.get(ptyName); } else { PathMetadata pm = createPropertyPath((Path<?>) hostExpression, ptyName); rv = newInstance(ptyClass, genericType, proxy, ptyName, pm); } aliasFactory.setCurrent(propToExpr.get(ptyName)); } else if (methodType == MethodType.SCALA_GETTER) { String ptyName = method.getName(); Class<?> ptyClass = method.getReturnType(); Type genericType = method.getGenericReturnType(); if (propToObj.containsKey(ptyName)) { rv = propToObj.get(ptyName); } else { PathMetadata pm = createPropertyPath((Path<?>) hostExpression, ptyName); rv = newInstance(ptyClass, genericType, proxy, ptyName, pm); } aliasFactory.setCurrent(propToExpr.get(ptyName)); } else if (methodType == MethodType.LIST_ACCESS || methodType == MethodType.SCALA_LIST_ACCESS) { // TODO : manage cases where the argument is based on a property invocation Object propKey = Arrays.asList(MethodType.LIST_ACCESS, args[0]); if (propToObj.containsKey(propKey)) { rv = propToObj.get(propKey); } else { PathMetadata pm = createListAccessPath((Path<?>) hostExpression, (Integer) args[0]); Class<?> elementType = ((ParameterizedExpression<?>) hostExpression).getParameter(0); rv = newInstance(elementType, elementType, proxy, propKey, pm); } aliasFactory.setCurrent(propToExpr.get(propKey)); } else if (methodType == MethodType.MAP_ACCESS || methodType == MethodType.SCALA_MAP_ACCESS) { Object propKey = Arrays.asList(MethodType.MAP_ACCESS, args[0]); if (propToObj.containsKey(propKey)) { rv = propToObj.get(propKey); } else { PathMetadata pm = createMapAccessPath((Path<?>) hostExpression, args[0]); Class<?> valueType = ((ParameterizedExpression<?>) hostExpression).getParameter(1); rv = newInstance(valueType, valueType, proxy, propKey, pm); } aliasFactory.setCurrent(propToExpr.get(propKey)); } else if (methodType == MethodType.TO_STRING) { rv = hostExpression.toString(); } else if (methodType == MethodType.HASH_CODE) { rv = hostExpression.hashCode(); } else if (methodType == MethodType.GET_MAPPED_PATH) { rv = hostExpression; } else { throw new IllegalArgumentException( "Invocation of " + method.getName() + " with types " + Arrays.asList(method.getParameterTypes()) + " not supported"); } return rv; } @SuppressWarnings({ "unchecked"}) @Nullable protected <T> T newInstance(Class<T> type, Type genericType, Object parent, Object propKey, PathMetadata metadata) { Expression<?> path; Object rv; if (String.class.equals(type)) { path = pathFactory.createStringPath(metadata); // null is used as a return value to block method invocations on Strings rv = null; } else if (Integer.class.equals(type) || int.class.equals(type)) { path = pathFactory.createNumberPath(Integer.class, metadata); rv = RETURN_VALUE; } else if (Byte.class.equals(type) || byte.class.equals(type)) { path = pathFactory.createNumberPath(Byte.class, metadata); rv = (byte) RETURN_VALUE; } else if (java.util.Date.class.equals(type)) { path = pathFactory.createDateTimePath((Class) type, metadata); rv = new Date(); } else if (java.sql.Timestamp.class.equals(type)) { path = pathFactory.createDateTimePath((Class) type, metadata); rv = new Timestamp(System.currentTimeMillis()); } else if (java.sql.Date.class.equals(type)) { path = pathFactory.createDatePath((Class) type, metadata); rv = new java.sql.Date(System.currentTimeMillis()); } else if (java.sql.Time.class.equals(type)) { path = pathFactory.createTimePath((Class) type, metadata); rv = new java.sql.Time(System.currentTimeMillis()); } else if (Long.class.equals(type) || long.class.equals(type)) { path = pathFactory.createNumberPath(Long.class, metadata); rv = (long) RETURN_VALUE; } else if (Short.class.equals(type) || short.class.equals(type)) { path = pathFactory.createNumberPath(Short.class, metadata); rv = (short) RETURN_VALUE; } else if (Double.class.equals(type) || double.class.equals(type)) { path = pathFactory.createNumberPath(Double.class, metadata); rv = (double) RETURN_VALUE; } else if (Float.class.equals(type) || float.class.equals(type)) { path = pathFactory.createNumberPath(Float.class, metadata); rv = (float) RETURN_VALUE; } else if (BigInteger.class.equals(type)) { path = pathFactory.createNumberPath((Class) type, metadata); rv = BigInteger.valueOf(RETURN_VALUE); } else if (BigDecimal.class.equals(type)) { path = pathFactory.createNumberPath((Class) type, metadata); rv = BigDecimal.valueOf(RETURN_VALUE); } else if (Boolean.class.equals(type) || boolean.class.equals(type)) { path = pathFactory.createBooleanPath(metadata); rv = Boolean.TRUE; } else if (typeSystem.isMapType(type)) { Class<Object> keyType = (Class) ReflectionUtils.getTypeParameter(genericType, 0); Class<Object> valueType = (Class) ReflectionUtils.getTypeParameter(genericType, 1); path = pathFactory.createMapPath(keyType, valueType, metadata); rv = aliasFactory.createAliasForProperty(type, path); } else if (typeSystem.isListType(type)) { Class<Object> elementType = (Class) ReflectionUtils.getTypeParameter(genericType, 0); path = pathFactory.createListPath(elementType, metadata); rv = aliasFactory.createAliasForProperty(type, path); } else if (typeSystem.isSetType(type)) { Class<?> elementType = ReflectionUtils.getTypeParameterAsClass(genericType, 0); path = pathFactory.createSetPath(elementType, metadata); rv = aliasFactory.createAliasForProperty(type, path); } else if (typeSystem.isCollectionType(type)) { Class<?> elementType = ReflectionUtils.getTypeParameterAsClass(genericType, 0); path = pathFactory.createCollectionPath(elementType, metadata); rv = aliasFactory.createAliasForProperty(type, path); } else if (Enum.class.isAssignableFrom(type)) { path = pathFactory.createEnumPath((Class) type, metadata); rv = type.getEnumConstants()[0]; } else if (type.isArray()) { path = pathFactory.createArrayPath((Class) type, metadata); rv = Array.newInstance(type.getComponentType(), 5); } else { if (Number.class.isAssignableFrom(type)) { path = pathFactory.createNumberPath((Class) type, metadata); } else if (Comparable.class.isAssignableFrom(type)) { path = pathFactory.createComparablePath((Class) type, metadata); } else { path = pathFactory.createEntityPath(type, metadata); } if (!Modifier.isFinal(type.getModifiers())) { rv = aliasFactory.createAliasForProperty(type, path); } else { rv = null; } } if (rv == null) { propToObj.remove(propKey); } else { propToObj.put(propKey, rv); } propToExpr.put(propKey, path); return (T) rv; } protected String propertyNameForGetter(Method method) { String name = method.getName(); name = name.startsWith("is") ? name.substring(2) : name.substring(3); return BeanUtils.uncapitalize(name); } protected PathMetadata createPropertyPath(Path<?> path, String propertyName) { return PathMetadataFactory.forProperty(path, propertyName); } protected PathMetadata createListAccessPath(Path<?> path, Integer index) { return PathMetadataFactory.forListAccess(path, index); } protected PathMetadata createMapAccessPath(Path<?> path, Object key) { return PathMetadataFactory.forMapAccess(path, key); } }
package io.github.ololx.cranberry.statement.internal.util; import java.util.Collection; import java.util.Map; /** * The type Statements. * * @author Alexander A. Kropotin * project cranberry * created 2020 -03-09 20:21 */ public final class Statements { /** * State not null. * * @param obj the obj * @param message the message */ //----->NOT NULL STATEMENTS public static void stateNotNull(Object obj, String message) { NotNullStatement.check(obj, message); } /** * State not null. * * @param obj the obj */ public static void stateNotNull(Object obj) { stateNotNull(obj, null); } /** * State not empty. * * @param str the str * @param message the message */ //----->NOT EMPTY STATEMENTS public static void stateNotEmpty(String str, String message) { NotEmptyStatement.check(str, message); } /** * State not empty. * * @param arr the arr * @param message the message */ public static void stateNotEmpty(Object[] arr, String message) { NotEmptyStatement.check(arr, message); } /** * State not empty. * * @param map the map * @param message the message */ public static void stateNotEmpty(Map<?, ?> map, String message) { NotEmptyStatement.check(map, message); } /** * State not empty. * * @param collection the collection * @param message the message */ public static void stateNotEmpty(Collection<?> collection, String message) { NotEmptyStatement.check(collection, message); } /** * State not empty. * * @param map the map */ public static void stateNotEmpty(Map<?, ?> map) { stateNotEmpty(map, null); } /** * State not empty. * * @param collection the collection */ public static void stateNotEmpty(Collection<?> collection) { stateNotEmpty(collection, null); } /** * State not empty. * * @param str the str */ public static void stateNotEmpty(String str) { stateNotEmpty(str, null); } /** * State not empty. * * @param arr the str */ public static void stateNotEmpty(Object[] arr) { stateNotEmpty(arr, null); } /** * State not blank. * * @param str the str * @param message the message */ //----->NOT BLANK STATEMENTS public static void stateNotBlank(String str, String message) { NotBlankStatement.check(str, message); } /** * State not blank. * * @param str the str */ public static void stateNotBlank(String str) { stateNotBlank(str, null); } /** * State this is true. * * @param expr the boolean expression */ //----->TRUE STATEMENTS public static void stateTrue(Boolean expr) { stateTrue(expr, null); } /** * State this is true. * * @param expr the boolean expression * @param message the message */ public static void stateTrue(Boolean expr, String message) { TrueStatement.check(expr, message); } }
/* * Copyright 2021 MicroEJ Corp. All rights reserved. * Use of this source code is governed by a BSD-style license that can be found with this software. */ /** * Contains the Circular dotted progress page. */ @ej.annotation.NonNullByDefault package com.microej.demo.widget.circulardottedprogress;
package com.ustwo.clockwise.companion; import android.util.Log; import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.api.GoogleApiClient; import com.google.android.gms.common.data.FreezableUtils; import com.google.android.gms.wearable.DataEvent; import com.google.android.gms.wearable.DataEventBuffer; import com.google.android.gms.wearable.DataMap; import com.google.android.gms.wearable.MessageEvent; import com.google.android.gms.wearable.WearableListenerService; import com.ustwo.clockwise.common.DataChangedHandler; import com.ustwo.clockwise.common.MessageReceivedHandler; import com.ustwo.clockwise.common.WearableAPIHelper; import com.ustwo.clockwise.companion.permissions.CompanionPermissionRequestMessageHandler; import java.util.ArrayList; import java.util.List; /** * Service that responds to all com.google.android.gms.wearable.BIND_LISTENER events from the wearable and routes the * incoming messages and data paths to the required handlers. * <p/> * Note that this is required because each application may only have one Service for the BIND_LISTENER action. * * @author mark@ustwo.com */ public class CompanionService extends WearableListenerService { private static final String TAG = CompanionService.class.getSimpleName(); protected WearableAPIHelper mWearableAPIHelper; protected final List<DataChangedHandler> mDataChangedHandlers = new ArrayList<>(); protected final List<MessageReceivedHandler> mMessageReceivedHandlers = new ArrayList<>(); @Override public void onCreate() { super.onCreate(); mMessageReceivedHandlers.add(new CompanionPermissionRequestMessageHandler(this)); mWearableAPIHelper = new WearableAPIHelper(this, new WearableAPIHelper.WearableAPIHelperListener() { @Override public void onWearableAPIConnected(GoogleApiClient apiClient) { } @Override public void onWearableAPIConnectionSuspended(int cause) { } @Override public void onWearableAPIConnectionFailed(ConnectionResult result) { } }); } @Override public void onDestroy() { mWearableAPIHelper.onDestroy(); super.onDestroy(); } @Override public void onDataChanged(DataEventBuffer dataEvents) { // Route the changed data event to the correct handler. final List<DataEvent> events = FreezableUtils.freezeIterable(dataEvents); for (DataEvent event : events) { String path = event.getDataItem().getUri().getPath(); for (DataChangedHandler handler : mDataChangedHandlers) { for(String supportedPath : handler.getSupportedPaths()) { // allow handler to define just the first part of the entire URI. if(path.startsWith(supportedPath)) { handler.onDataChanged(path, event, mWearableAPIHelper); break; } } } } } @Override public void onMessageReceived(MessageEvent messageEvent) { String path = messageEvent.getPath(); Log.v(TAG, "onMessageReceived: " + path); for (MessageReceivedHandler handler : mMessageReceivedHandlers) { if (null != handler.getSupportedPaths() && handler.getSupportedPaths().contains(path)) { byte[] rawData = messageEvent.getData(); DataMap dataMap = DataMap.fromByteArray(rawData); handler.onMessageReceived(path, dataMap, mWearableAPIHelper); } } } }
package com.alibaba.com.caucho.hessian.io.beans; import java.io.Serializable; /** */ public class SubUser extends BaseUser implements Serializable { private static final long serialVersionUID = 4017613093053853415L; private String userName; @Override public String getUserName() { return userName; } @Override public void setUserName(String userName) { this.userName = userName; } }
package io.dropwizard.redis.netty; import com.codahale.metrics.MetricRegistry; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.common.io.Resources; import io.dropwizard.configuration.YamlConfigurationFactory; import io.dropwizard.jackson.DiscoverableSubtypeResolver; import io.dropwizard.jackson.Jackson; import io.dropwizard.jersey.validation.Validators; import io.netty.util.concurrent.DefaultEventExecutorGroup; import org.junit.Test; import java.io.File; import javax.validation.Validator; import static org.assertj.core.api.Assertions.assertThat; public class DefaultEventExecutorGroupFactoryTest { private final ObjectMapper objectMapper = Jackson.newObjectMapper(); private final Validator validator = Validators.newValidator(); private final YamlConfigurationFactory<EventExecutorGroupFactory> configFactory = new YamlConfigurationFactory<>(EventExecutorGroupFactory.class, validator, objectMapper, "dw"); @Test public void shouldBuildADefaultEventExecutorGroup() throws Exception { final File yml = new File(Resources.getResource("yaml/netty/default.yaml").toURI()); final EventExecutorGroupFactory factory = configFactory.build(yml); assertThat(factory) .isInstanceOf(DefaultEventExecutorGroupFactory.class); final DefaultEventExecutorGroupFactory defaultEventExecutorGroupFactory = (DefaultEventExecutorGroupFactory) factory; assertThat(defaultEventExecutorGroupFactory.build(5, "name", new MetricRegistry())) .isInstanceOf(DefaultEventExecutorGroup.class); } @Test public void isDiscoverable() { assertThat(new DiscoverableSubtypeResolver().getDiscoveredSubtypes()) .contains(DefaultEventExecutorGroupFactory.class); } }
package app.hongs.db; import app.hongs.HongsError; import app.hongs.HongsException; import app.hongs.db.DB.Roll; import app.hongs.util.Dict; import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; /** * 查询结构及操作 * * <p> * 字段名前, 用"."表示属于当前表, 用":"表示属于上级表.<br/> * 关联字段, 用"表.列"描述字段时, "."的两侧不得有空格.<br/> * 本想自动识别字段的所属表(可部分区域), 但总是出问题;<br/> * 好的规则胜过万行代码, 定此规矩, 多敲了一个符号而已.<br/> * setOption用于登记特定查询选项, 以备组织查询结构的过程中读取. * </p> * * <p> * [2015/11/24 00:28] * 已解决加表名前缀的问题; * 上级表请使用上级表别名; * 且兼容上面旧的前缀规则. * 增加了表示别名的前缀"!", 单纯统计行数须写 COUNT(!*). * 以下 select,where,groupBy,havin,orderBy,on 均可如此. * 本类处理一般的查询尚可, 过于复杂的 SQL 语句不用为好. * </p> * * <h3>将SQL语句拆解成以下对应部分:</h3> * <pre> * fields SELECT field1, field2... * tableName name FROM tableName AS name * wheres WHERE expr1 AND expr2... * groups GROUP BY field1, field2... * havins HAVING expr1 AND expr2... * orders ORDER BY field1, field2... * limits LIMIT start, limit * </pre> * * <h3>系统已定义的"options":</h3> * <pre> * ASSOCS : Set 仅对某些表做关联; 作用域: FetchMore.fetchMore * ASSOC_TYPES : Set 仅对某些类型关联; 作用域: FetchMore.fetchMore * ASSOC_JOINS : Set 仅对某些类型连接; 作用域: FetchMore.fetchMore * ASSOC_MULTI : boolean 多行关联(使用IN方式关联); 作用域: FetchMore * ASSOC_MERGE : boolean 归并关联(仅限非多行关联); 作用域: FetchMore * FETCH_OBJECT : boolean 获取对象; 作用域: DB.fetchMore * page : int|String 分页页码; 作用域: FetchPage * pags : int|String 链接数量; 作用域: FetchPage * rows : int|String 分页行数; 作用域: FetchPage * </pre> * * <h3>异常代码:</h3> * <pre> * 区间: 0x10b0~0x10bf * 0x10b0 无法识别关联类型(JOIN) * 0x10b2 必须指定关联条件(FULL|LEFT|RIGHT)_JOIN * 0x10b4 没有指定查询表名 * 0x10b6 没有指定查询的库 * </pre> * * @author Hongs */ public class FetchCase implements Cloneable, Serializable { protected String tableName; protected String name; protected StringBuilder fields; protected StringBuilder wheres; protected StringBuilder groups; protected StringBuilder havins; protected StringBuilder orders; protected int[] limits; protected List<Object> wparams; protected List<Object> hparams; protected Map<String, Object> options; protected byte joinType; protected String joinExpr; protected Set<FetchCase> joinList; public static final byte LEFT = 1; public static final byte RIGHT = 2; public static final byte FULL = 3; public static final byte INNER = 4; public static final byte CROSS = 5; private static final Pattern pc = Pattern .compile("(?<![`\\w])[\\.:!](`.+?`|\\w+|\\*)"); private static final Pattern ps = Pattern .compile("^\\s*,\\s*"/*...*/, Pattern.CASE_INSENSITIVE); private static final Pattern pw = Pattern .compile("^\\s*(AND|OR)\\s+", Pattern.CASE_INSENSITIVE); private static final Pattern p0 = Pattern .compile("('.+?'|`.+?`|\\w+|\\*|\\))\\s*"); // 后面不跟字段可跟别名, \\d 换成 \\w 则不处理没 "`" 包裹的字段 private static final Pattern p1 = Pattern .compile("AS|END|NULL|TRUE|FALSE|\\)|\\d.*" , Pattern.CASE_INSENSITIVE); // 后面可跟字段的关键词 private static final Pattern p2 = Pattern .compile("IN|IS|ON|OR|AND|NOT|TOP|CASE|WHEN|THEN|ELSE|LIKE|ESCAPE|BETWEEN|DISTINCT" , Pattern.CASE_INSENSITIVE); //** 构造 **/ /** * 构建表结构对象 */ public FetchCase() { this.tableName = null; this.name = null; this.fields = new StringBuilder(); this.wheres = new StringBuilder(); this.groups = new StringBuilder(); this.havins = new StringBuilder(); this.orders = new StringBuilder(); this.limits = new int[0]; this.wparams = new ArrayList(); this.hparams = new ArrayList(); this.options = new HashMap (); this.joinType = 0 ; this.joinExpr = ""; this.joinList = new LinkedHashSet(); } /** * 克隆 * @return 新查询结构对象 */ @Override public FetchCase clone() { try { FetchCase caze = (FetchCase) super.clone( ); caze.fields = new StringBuilder( this.fields ); caze.wheres = new StringBuilder( this.wheres ); caze.groups = new StringBuilder( this.groups ); caze.havins = new StringBuilder( this.havins ); caze.orders = new StringBuilder( this.orders ); caze.limits = this.limits.clone( ); caze.wparams = new ArrayList(this.wparams); caze.hparams = new ArrayList(this.hparams); caze.options = new HashMap (this.options); caze.joinType = 0 ; caze.joinExpr = ""; caze.joinList = new LinkedHashSet(this.joinList); return caze; } catch (CloneNotSupportedException ex) { throw new HongsError.Common(ex); } } //** 查询 **/ /*** * 设置查询表和别名 * @param tableName * @param name * @return 当前查询结构对象 */ public FetchCase from(String tableName, String name) { this.tableName = tableName; this.name = name; return this; } /** * 设置查询表(如果别名已设置则不会更改) * @param tableName * @return 当前查询结构对象 */ public FetchCase from(String tableName) { this.tableName = tableName; if (this.name == null) this.name = tableName; return this; } /** * 追加查询字段 * 必须包含当前表字段, 必须在当前表字段前加"." * @param fields * @return 当前查询结构对象 */ public FetchCase select(String fields) { this.fields.append(", ").append(fields); return this; } /** * 追加查询条件 * 字段名前, 用"."表示属于当前表, 用":"表示属于上级表 * @param where * @param params 对应 where 中的 ? * @return 当前查询结构对象 */ public FetchCase where(String where, Object... params) { this.wheres.append(" AND ").append(where); this.wparams.addAll(Arrays.asList(params)); return this; } /** * 追加分组字段 * 必须包含当前表字段, 必须在当前表字段前加"." * @param fields * @return 当前查询结构对象 */ public FetchCase groupBy(String fields) { this.groups.append(", ").append(fields); return this; } /** * 追加过滤条件 * 字段名前, 用"."表示属于当前表, 用":"表示属于上级表 * @param where * @param params 对应 where 中的 ? * @return 当前查询结构对象 */ public FetchCase havin(String where, Object... params) { this.havins.append(" AND ").append(where); this.hparams.addAll(Arrays.asList(params)); return this; } /** * 追加排序字段 * 必须包含当前表字段, 必须在当前表字段前加"." * @param fields * @return 当前查询结构对象 */ public FetchCase orderBy(String fields) { this.orders.append(", ").append(fields); return this; } //** 限额 **/ /** * 设置限额 * @param start * @param limit * @return 当前查询结构对象 */ public FetchCase limit(int start, int limit) { this.limits = limit == 0 ? new int[0] : new int[] {start, limit}; return this; } /** * 设置限额 * @param limit * @return 当前查询结构对象 */ public FetchCase limit(int limit) { this.limits = limit == 0 ? new int[0] : new int[] { 0 , limit}; return this; } //** 关联 **/ public FetchCase join(String tableName, String name) { FetchCase caze = this.join(new FetchCase()); caze.from(tableName, name); return caze; } public FetchCase join(String tableName) { FetchCase caze = this.join(new FetchCase()); caze.from(tableName); return caze; } public FetchCase join(FetchCase caze) { caze.options = this.options; this.joinList.add(caze); caze.joinExpr = null; caze.joinType = LEFT; return caze; } public FetchCase on(String expr) { this.joinExpr = expr; return this; } public FetchCase by( byte type) { this.joinType = type; return this; } //** 获取结果 **/ /** * 获取SQL * @return SQL */ public String getSQL() { return this.getSQLStrb().toString(); } /** * 获取SQL字串 * @return SQL字串 */ private StringBuilder getSQLStrb() { StringBuilder t = new StringBuilder(); StringBuilder f = new StringBuilder(); StringBuilder g = new StringBuilder(); StringBuilder o = new StringBuilder(); StringBuilder w = new StringBuilder(); StringBuilder h = new StringBuilder(); this.getSQLDeep( t, f, g, o, w, h, null); StringBuilder sql = new StringBuilder("SELECT"); // 字段 if (f.length() != 0) { sql.append( " " ) .append(ps.matcher(f).replaceFirst("")); } else { sql.append(" `" ) .append(this.name) .append("`.*"); } // 表名 sql.append(" FROM ").append(t); // 条件 if (w.length() != 0) { sql.append(" WHERE " ) .append(pw.matcher(w).replaceFirst("")); } // 分组 if (g.length() != 0) { sql.append(" GROUP BY ") .append(ps.matcher(g).replaceFirst("")); } // 过滤 if (h.length() != 0) { sql.append(" HAVING ") .append(pw.matcher(h).replaceFirst("")); } // 排序 if (o.length() != 0) { sql.append(" ORDER BY ") .append(ps.matcher(o).replaceFirst("")); } // 限额, 不同库不同方式, 就不在此处理了 // if (this.limits.length > 0) // { // sql.append(" LIMIT ?, ?"); // } // sql = DB.formatSQLFields(sql); return sql; } /** * 获取SQL组合 * @return SQL组合 */ private void getSQLDeep(StringBuilder t, StringBuilder f, StringBuilder g, StringBuilder o, StringBuilder w, StringBuilder h, String pn) { if (this.tableName == null || this.tableName.length() == 0) { throw new Error( new HongsException(0x10b4) ); } // 表名 String tn; StringBuilder b = new StringBuilder(); b.append("`").append(this.tableName ).append("`"); if (this.name != null && this.name.length() != 0 && !this.name.equals(this.tableName)) { b.append(" AS `").append(this.name).append("`"); tn = this.name; } else { tn = this.tableName; } // 关联 if (pn != null) { switch (this.joinType) { case FetchCase.LEFT : b.insert(0, " LEFT JOIN "); break; case FetchCase.RIGHT: b.insert(0," RIGHT JOIN "); break; case FetchCase.FULL : b.insert(0, " FULL JOIN "); break; case FetchCase.INNER: b.insert(0," INNER JOIN "); break; case FetchCase.CROSS: b.insert(0," CROSS JOIN "); break; default: return; } if (this.joinExpr != null && this.joinExpr.length() != 0) { String s = this.joinExpr; s = addSQLTbls( s, tn, pn); b.append(" ON ").append(s); } } t.append(b); // 字段 if (this.fields.length() != 0) { String s = this.fields.toString().trim(); s = addSQLTbls(s, tn, pn); f.append(" ").append( s ); } // 条件 if (this.wheres.length() != 0) { String s = this.wheres.toString().trim(); s = addSQLTbls(s, tn, pn); w.append(" ").append( s ); } // 分组 if (this.groups.length() != 0) { String s = this.groups.toString().trim(); s = addSQLTbls(s, tn, pn); g.append(" ").append( s ); } // 下级 for ( FetchCase caze : this.joinList) { if ( caze.joinType != 0 ) { caze.getSQLDeep(t,f, g,o, w,h, tn); } } // 过滤 if (this.havins.length() != 0) { String s = this.havins.toString().trim(); s = addSQLTbls(s, tn, pn); h.append(" ").append( s ); } // 排序 if (this.orders.length() != 0) { String s = this.orders.toString().trim(); s = addSQLTbls(s, tn, pn); o.append(" ").append( s ); } } /** * 替换SQL表名 * @param s * @param tn * @param pn * @return */ private String addSQLTbls(String s, String tn, String pn) { // 没有关联表则直接去掉前缀 if (this.joinList.isEmpty() && this.joinType == 0 ) { return delSQLTbls( s ); } Matcher m; String x, y, z; StringBuffer b; StringBuffer c = new StringBuffer(s); z = "`"+tn+"`.$0"; m = p0.matcher(c); b = new StringBuffer(); int i , j, k = -1, l = c.length(); while ( m.find( )) { // System.out.println(m.group()); // 以 .|(|{ 结尾的要跳过 j = m.end ( ); if ( j < l ) { char r = c.charAt(j/**/); if ( r == '.' || r == '(' || r == '{' ) { k = j; continue; } } // 以 .|:|! 开头的要跳过 i = m.start(); if ( i > 0 ) { char r = c.charAt(i - 1); if ( r == '.' || r == ':' || r == '!' ) { k = j; continue; } } x = m.group(1); if (x.startsWith("'")/*ST*/) { // 字符串后不跟字段 k = j; } else if (x.startsWith("*")&&k==i) { // 跳过乘号且不偏移 } else if (p2.matcher(x).matches()) { // 跳过保留字不偏移 } else if (p1.matcher(x).matches()) { // 跳过别名和数字等 k = j; } else if (k == i) { // 紧挨前字段要跳过 k = j; } else { // 为字段添加表前缀 k = j; m.appendReplacement(b,z); } } c = m.appendTail(b); x = "$1"; y = "`"+pn+"`.$1"; z = "`"+tn+"`.$1"; m = pc.matcher(c); b = new StringBuffer(); while ( m.find( )) { switch (c.charAt(m.start())) { case '.': m.appendReplacement(b, z); break; case ':': m.appendReplacement(b, y); break; case '!': m.appendReplacement(b, x); break; } } c = m.appendTail(b); return c.toString(); } /** * 替换SQL表名 * @param s * @return */ private String delSQLTbls(String s) { Matcher m; String x; StringBuffer b; StringBuffer c = new StringBuffer(s); x = "$1"; m = pc.matcher(c); b = new StringBuffer(); while ( m.find( )) { m.appendReplacement(b, x); } c = m.appendTail(b); return c.toString(); } public int getStart() { return this.limits.length > 0 ? this.limits[0] : 0; } public int getLimit() { return this.limits.length > 1 ? this.limits[1] : 0; } /** * 获取参数 * @return 参数 */ public Object[] getParams() { return this.getParamsList().toArray(); } /** * 获取参数列表 * @return 参数列表 */ private List getParamsList() { List paramz = new ArrayList(); List wparamz = new ArrayList(); List hparamz = new ArrayList(); // 参数 this.getParamsDeep(wparamz, hparamz); paramz.addAll(wparamz); paramz.addAll(hparamz); // 限额(不同数据库的限额方式不一样, 在 DB.limit 中实现) // if (this.limits.length > 0) // { // paramz.add(this.limits[0]); // paramz.add(this.limits[1]); // } return paramz; } /** * 获取参数组合 * @return 参数组合 */ private void getParamsDeep(List wparamz, List hparamz) { wparamz.addAll(this.wparams); hparamz.addAll(this.hparams); for (FetchCase caze : this.joinList) { if (0 == caze.joinType) { continue; } caze.getParamsDeep(wparamz, hparamz); } } /** * 转换为字符串 * @return 合并了SQL和参数 */ @Override public String toString() { StringBuilder sb = this.getSQLStrb(); List paramz = this.getParamsList(); try { DB.checkSQLParams(sb, paramz); DB.mergeSQLParams(sb, paramz); } catch (HongsException ex) { return null; } return sb.toString(); } //** 获取关联 **/ /** * 获取关联对象 * @param name * @return */ public FetchCase getJoin(String name) { for (FetchCase caze : this.joinList) { if (name.equals(caze.name)) { return caze; } } return null; } /** * 获取关联的关联对象 * @param name * @return */ public FetchCase getJoin(String... name) { FetchCase caze = this; for (String n : name) { FetchCase c = caze.getJoin(n); if (null != c) { caze = c; } else { caze = null; break; /* ignore */ } } return caze; } /** * 获取关联的关联对象 * * 与 getJoin 不同在于不存在的关联会自动则创建 * 注意: * 命名虽与 Core.got 类似, 但意义却不同 * Core.got 为调用原 Map 的 get, 没有则返回 null * FetchCase.gotJoin 相反没有则创建关联 * * @param name * @return * @throws HongsException */ public FetchCase gotJoin(String... name) throws HongsException { FetchCase caze = this; for (String n : name) { FetchCase c = caze.getJoin(n); if (null != c) { caze = c; } else { caze = caze.join(n).by((byte)0); } } return caze; } //** 获取选项 **/ /** * 是否存在选项 * @param key * @return 存在为true, 反之为false */ public boolean hasOption(String key) { return this.options.containsKey(key); } /** * 获取选项 * @param key * @return 指定选项 */ public Object getOption(String key) { return this.options.get(key); } /** * 获取选项(可指定类型) * @param <T> * @param key * @param def * @return 指定选项 */ public <T> T getOption(String key, T def) { return Dict.getValue(options, def, key); } /** * 设置参数(单个) * @param key * @param obj * @return 当前查询结构对象 */ public FetchCase setOption(String key, Object obj) { this.options.put(key, obj); return this; } //** 不推荐的方法 **/ /** * 是否有设置表名 * @return 存在未true, 反之为false * @deprecated */ public boolean hasFrom() { return this.tableName != null; } /** * 是否有关联的表 * @return 存在未true, 反之为false * @deprecated */ public boolean hasJoin() { return !this.joinList.isEmpty(); } /** * 是否有设置查询字段 * @return 存在为true, 反之为false * @deprecated */ public boolean hasSelect() { return this.fields.length() != 0; } /** * 设置查询字段 * @param fields * @return 当前查询结构对象 * @deprecated */ public FetchCase setSelect(String fields) { this.fields = new StringBuilder(checkField(fields)); return this; } /** * 是否有设置查询条件 * @return 存在为true, 反之为false * @deprecated */ public boolean hasWhere() { return this.wheres.length() != 0; } /** * 设置查询条件 * 字段名前, 用"."表示属于当前表, 用":"表示属于上级表 * @param where * @param params 对应 where 中的 ? * @return 当前查询结构对象 * @deprecated */ public FetchCase setWhere(String where, Object... params) { this.wheres = new StringBuilder(checkWhere(where)); this.wparams = Arrays.asList(params); return this; } /** * 是否有设置分组 * @return 存在为true, 反之为false * @deprecated */ public boolean hasGroupBy() { return this.groups.length() != 0; } /** * 设置分组字段 * @param fields * @return 当前查询结构对象 * @deprecated */ public FetchCase setGroupBy(String fields) { this.groups = new StringBuilder(checkField(fields)); return this; } /** * @deprecated */ public boolean hasHavin() { return this.havins.length() != 0; } /** * @deprecated */ public FetchCase setHavin(String where, Object... params) { this.havins = new StringBuilder(checkWhere(where)); this.hparams = Arrays.asList(params); return this; } /** * 是否有设置排序 * @return 存在为true, 反之为false * @deprecated */ public boolean hasOrderBy() { return this.orders.length() != 0; } /** * 设置排序字段 * @param fields * @return 当前查询结构对象 * @deprecated */ public FetchCase setOrderBy(String fields) { this.orders = new StringBuilder(checkField(fields)); return this; } private String checkField(String field) { if (field == null) return ""; field = field.trim(); if (field.length() != 0 && !field.startsWith(",")) { return ", " + field; } else { return field; } } private String checkWhere(String where) { if (where == null) return ""; where = where.trim(); if (where.length() != 0 && !where.matches("^(AND|OR) (?i)")) { return "AND " + where; } else { return where; } } //** 串联查询/操作 **/ private DB _db_ = null; /** * 指定查询要查询的库 * @param db * @return */ public FetchCase use(DB db) { _db_ = db ; return this; } /** * 查询并获取结果迭代 * @return * @throws HongsException */ public Roll rol() throws HongsException { if (_db_ == null) { throw new HongsException(0x10b6); } return _db_.queryMore(this); } /** * 查询并获取全部结果 * @return * @throws HongsException */ public List all() throws HongsException { if (_db_ == null) { throw new HongsException(0x10b6); } return _db_.fetchMore(this); } /** * 查询并获取单个结果 * @return * @throws HongsException */ public Map one() throws HongsException { if (_db_ == null) { throw new HongsException(0x10b6); } return _db_.fetchLess(this); } /** * 删除全部匹配的记录 * 注意: 会忽略 join 的条件, 有 :fn, xx.fn 的字段条件会报 SQL 错误 * @return * @throws HongsException */ public int delete() throws HongsException { if (_db_ == null) { throw new HongsException(0x10b6); } return _db_.delete(tableName, delSQLTbls(wheres.toString()), wparams.toArray()); } /** * 更新全部匹配的数据 * 注意: 会忽略 join 的条件, 有 :fn, xx.fn 的字段条件会报 SQL 错误 * @param dat * @return * @throws HongsException */ public int update(Map<String, Object> dat) throws HongsException { if (_db_ == null) { throw new HongsException(0x10b6); } return _db_.update(tableName, dat, delSQLTbls(wheres.toString()), wparams.toArray()); } /** * 插入当前指定的数据 * 其实与 FetchCase 无关, 因为 insert 是没有 where 等语句的 * 但为保持支持的语句完整让 Table 更像 ORM 还是在这里放一个 * @param dat * @return * @throws HongsException */ public int insert(Map<String, Object> dat) throws HongsException { if (_db_ == null) { throw new HongsException(0x10b6); } return _db_.insert(tableName, dat); } }
package live; /** * Created by m on 9/2/16. */ public class ReferencePlayground { }
/** * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies * * Please see distribution for license. */ package com.opengamma.analytics.financial.interestrate.fra.provider; import static org.testng.AssertJUnit.assertEquals; import java.util.LinkedHashMap; import org.testng.annotations.Test; import org.threeten.bp.ZonedDateTime; import com.opengamma.analytics.financial.instrument.fra.ForwardRateAgreementDefinition; import com.opengamma.analytics.financial.instrument.index.IborIndex; import com.opengamma.analytics.financial.interestrate.InstrumentDerivative; import com.opengamma.analytics.financial.interestrate.annuity.derivative.Annuity; import com.opengamma.analytics.financial.interestrate.datasets.StandardDataSetsMulticurveUSD; import com.opengamma.analytics.financial.interestrate.payments.derivative.CouponFixed; import com.opengamma.analytics.financial.interestrate.payments.derivative.Payment; import com.opengamma.analytics.financial.provider.calculator.discounting.ParRateDiscountingCalculator; import com.opengamma.analytics.financial.provider.calculator.discounting.PresentValueCurveSensitivityDiscountingCalculator; import com.opengamma.analytics.financial.provider.calculator.discounting.PresentValueDiscountingCalculator; import com.opengamma.analytics.financial.provider.calculator.discounting.PresentValueDiscountingMultipleInstrumentsCalculator; import com.opengamma.analytics.financial.provider.calculator.generic.MarketQuoteSensitivityBlockCalculator; import com.opengamma.analytics.financial.provider.curve.CurveBuildingBlockBundle; import com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderDiscount; import com.opengamma.analytics.financial.provider.description.interestrate.MulticurveProviderInterface; import com.opengamma.analytics.financial.provider.sensitivity.multicurve.MultipleCurrencyParameterSensitivity; import com.opengamma.analytics.financial.provider.sensitivity.parameter.ParameterSensitivityParameterCalculator; import com.opengamma.analytics.financial.util.AssertSensitivityObjects; import com.opengamma.analytics.math.matrix.DoubleMatrix1D; import com.opengamma.financial.convention.calendar.Calendar; import com.opengamma.util.money.Currency; import com.opengamma.util.money.MultipleCurrencyAmount; import com.opengamma.util.test.TestGroup; import com.opengamma.util.time.DateUtils; import com.opengamma.util.tuple.ObjectsPair; import com.opengamma.util.tuple.Pair; import com.opengamma.util.tuple.Pairs; /** * Tests the ForwardRateAgreement discounting method with standard data. */ @Test(groups = TestGroup.UNIT) public class ForwardRateAgreementDiscountingMethodE2ETest { private static final IborIndex[] INDEX_IBOR_LIST = StandardDataSetsMulticurveUSD.indexIborArrayUSDOisL3(); private static final IborIndex USDLIBOR3M = INDEX_IBOR_LIST[0]; private static final Calendar CALENDAR = StandardDataSetsMulticurveUSD.calendarArray()[0]; private static final Currency CUR = USDLIBOR3M.getCurrency(); private static final PresentValueDiscountingCalculator PVDC = PresentValueDiscountingCalculator.getInstance(); private static final PresentValueDiscountingMultipleInstrumentsCalculator PVMULTIDC = PresentValueDiscountingMultipleInstrumentsCalculator.getInstance(); private static final ParRateDiscountingCalculator PRDC = ParRateDiscountingCalculator.getInstance(); private static final PresentValueCurveSensitivityDiscountingCalculator PVCSDC = PresentValueCurveSensitivityDiscountingCalculator.getInstance(); private static final ParameterSensitivityParameterCalculator<MulticurveProviderInterface> PSC = new ParameterSensitivityParameterCalculator<>(PVCSDC); // Test with standard data - harcoded numbers private static final ZonedDateTime STD_REFERENCE_DATE = DateUtils.getUTCDate(2014, 1, 22); // Instrument description private static final ZonedDateTime STD_ACCRUAL_START_DATE = DateUtils.getUTCDate(2014, 9, 12); private static final ZonedDateTime STD_ACCRUAL_END_DATE = DateUtils.getUTCDate(2014, 12, 12); private static final double STD_FRA_RATE = 0.0125; private static final double STD_NOTIONAL = -10000000; //-10m private static final ForwardRateAgreementDefinition STD_FRA_STD_DEFINITION = ForwardRateAgreementDefinition.from(STD_ACCRUAL_START_DATE, STD_ACCRUAL_END_DATE, STD_NOTIONAL, USDLIBOR3M, STD_FRA_RATE, CALENDAR); private static final Payment STD_FRA = STD_FRA_STD_DEFINITION.toDerivative(STD_REFERENCE_DATE); // Data private static final Pair<MulticurveProviderDiscount, CurveBuildingBlockBundle> MULTICURVE_PAIR_STD = StandardDataSetsMulticurveUSD.getCurvesUSDOisL3(); private static final MulticurveProviderDiscount MULTICURVE_STD = MULTICURVE_PAIR_STD.getFirst(); private static final CurveBuildingBlockBundle BLOCK_STD = MULTICURVE_PAIR_STD.getSecond(); private static final MarketQuoteSensitivityBlockCalculator<MulticurveProviderInterface> MQSBC = new MarketQuoteSensitivityBlockCalculator<>(PSC); private static final double STD_TOLERANCE_PV = 1.0E-3; private static final double STD_TOLERANCE_PV_DELTA = 1.0E-2; private static final double STD_TOLERANCE_RATE = 1.0E-5; private static final double BP1 = 1.0E-4; @Test /** * Test different results with a standard set of data against hard-coded values. Can be used for platform testing or regression testing. */ public void presentValue() { // Present Value final MultipleCurrencyAmount pvComputed = STD_FRA.accept(PVDC, MULTICURVE_STD); final MultipleCurrencyAmount pvExpected = MultipleCurrencyAmount.of(Currency.USD, 23182.5437); assertEquals("ForwardRateAgreementDiscountingMethod: present value from standard curves", pvExpected.getAmount(CUR), pvComputed.getAmount(CUR), STD_TOLERANCE_PV); } @Test /** * Test different results with a standard set of data against hardcoded values. Can be used for platform testing or regression testing */ public void presentValueAfterFee() { // fee offsets PV Annuity<?> fee = new Annuity<>(new CouponFixed[] {new CouponFixed(Currency.USD, 1. / 365, 1, -23182.647032590383, 1) }); // Present Value Pair<InstrumentDerivative[], MulticurveProviderInterface> data = Pairs.of(new InstrumentDerivative[] {fee }, (MulticurveProviderInterface) MULTICURVE_STD); final MultipleCurrencyAmount pvComputed = STD_FRA.accept(PVMULTIDC, data); final MultipleCurrencyAmount pvExpected = MultipleCurrencyAmount.of(Currency.USD, 0); assertEquals("ForwardRateAgreementDiscountingMethod: present value after fee from standard curves", pvExpected.getAmount(CUR), pvComputed.getAmount(CUR), STD_TOLERANCE_PV); } @Test /** * Test different results with a standard set of data against hard coded values. Can be used for platform testing or regression testing. */ public void BucketedPV01() { // Delta final double[] deltaDsc = {-0.007, -0.007, 0.000, -0.005, -0.031, -0.552, -1.041, 0.247, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }; final double[] deltaFwd = {119.738, 120.930, -26.462, -460.755, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000 }; final LinkedHashMap<Pair<String, Currency>, DoubleMatrix1D> sensitivity = new LinkedHashMap<>(); sensitivity.put(ObjectsPair.of(MULTICURVE_STD.getName(CUR), CUR), new DoubleMatrix1D(deltaDsc)); sensitivity.put(ObjectsPair.of(MULTICURVE_STD.getName(USDLIBOR3M), CUR), new DoubleMatrix1D(deltaFwd)); final MultipleCurrencyParameterSensitivity pvpsExpected = new MultipleCurrencyParameterSensitivity(sensitivity); final MultipleCurrencyParameterSensitivity pvpsComputed = MQSBC.fromInstrument(STD_FRA, MULTICURVE_STD, BLOCK_STD).multipliedBy(BP1); AssertSensitivityObjects.assertEquals("ForwardRateAgreementDiscountingMethod: bucketed delts from standard curves", pvpsExpected, pvpsComputed, STD_TOLERANCE_PV_DELTA); } @Test /** * Test different results with a standard set of data against hardcoded values. Can be used for platform testing or regression testing. */ public void parRate() { final double parRate = STD_FRA.accept(PRDC, MULTICURVE_STD); final double parRateExpected = 0.003315; assertEquals("ForwardRateAgreementDiscountingMethod: par rate from standard curves", parRateExpected, parRate, STD_TOLERANCE_RATE); } }
package com.gps.payroll.profileAndAbout; import android.Manifest; import android.app.ProgressDialog; import android.content.Context; import android.content.Intent; import android.content.pm.PackageManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.Uri; import android.os.Bundle; import androidx.activity.result.ActivityResultCallback; import androidx.activity.result.ActivityResultLauncher; import androidx.activity.result.contract.ActivityResultContracts; import androidx.annotation.NonNull; import androidx.appcompat.app.AlertDialog; import androidx.cardview.widget.CardView; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentTransaction; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ProgressBar; import android.widget.TextView; import android.widget.Toast; import com.google.firebase.auth.FirebaseAuth; import com.google.firebase.auth.FirebaseUser; import com.google.firebase.auth.UserProfileChangeRequest; import com.google.firebase.database.DataSnapshot; import com.google.firebase.database.DatabaseError; import com.google.firebase.database.DatabaseReference; import com.google.firebase.database.FirebaseDatabase; import com.google.firebase.database.ValueEventListener; import com.google.firebase.storage.FirebaseStorage; import com.google.firebase.storage.StorageReference; import com.gps.payroll.authentication.LoginActivity; import com.gps.payroll.backPageListener.BackListenerFragment; import com.gps.payroll.splashAndDashboard.MainActivity; import com.gps.payroll.splashAndDashboard.Dashboard; import com.gps.payroll.modelClasses.StoreUserImageUrlData; import com.gps.payroll.R; import com.squareup.picasso.Picasso; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.util.Objects; import de.hdodenhof.circleimageview.CircleImageView; public class ProfileFragment extends Fragment implements BackListenerFragment, View.OnClickListener { private View views; private Fragment fragment; private NetworkInfo netInfo; private ConnectivityManager cm; private StorageReference storageReference; private ProgressBar progressBar; private int PERMISSION_REQUEST_CODE = 101; private ProgressDialog dialog; private CircleImageView profilePic; private static Uri uriProfileImage; private FragmentTransaction fragmentTransaction; public static BackListenerFragment backBtnListener; private DatabaseReference databaseReference, imageReference; private TextView phone, email, name, nid, address; private CardView resetPass, logout, backFromProfile, editNid, editAddress, changeImage; private String messageRole, userPhone, userEmailText, profileImageUrl="", userNid, userAddress; @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { views = inflater.inflate(R.layout.fragment_profile, container, false); dialog = new ProgressDialog(getActivity()); progressBar = views.findViewById(R.id.profileProgressId); resetPass = views.findViewById(R.id.resetPassId); resetPass.setOnClickListener(this); logout = views.findViewById(R.id.logoutId); logout.setOnClickListener(this); backFromProfile = views.findViewById(R.id.backFromProfileId); backFromProfile.setOnClickListener(this); profilePic = views.findViewById(R.id.profilePicId); profilePic.setOnClickListener(this); editNid = views.findViewById(R.id.uploadNidId); editNid.setOnClickListener(this); editAddress = views.findViewById(R.id.uploadAddressId); editAddress.setOnClickListener(this); changeImage = views.findViewById(R.id.uploadProfilePicId); changeImage.setOnClickListener(this); phone = views.findViewById(R.id.userPhoneId); email = views.findViewById(R.id.userEmailId); name = views.findViewById(R.id.userNameId); nid = views.findViewById(R.id.userNidId); address = views.findViewById(R.id.userAddressId); try{ messageRole = requireArguments().getString("messageRole"); if(messageRole.equals("adminS")){ getAdminPhone(); databaseReference = FirebaseDatabase.getInstance().getReference("Admin Info"); editNid.setVisibility(View.GONE); editAddress.setVisibility(View.GONE); } else if(messageRole.equals("employeeS")){ userPhone = Objects.requireNonNull(FirebaseAuth.getInstance().getCurrentUser()).getDisplayName(); databaseReference = FirebaseDatabase.getInstance().getReference("Employee Info"); editNid.setVisibility(View.VISIBLE); editAddress.setVisibility(View.VISIBLE); } } catch (Exception e){ Log.i("Exception", e.getMessage()); } imageReference = FirebaseDatabase.getInstance().getReference("User Images"); getUserInfo(); return views; } private void getAdminPhone(){ try { String recievedMessageTc; FileInputStream fileInputStreamTc = requireActivity().openFileInput("Admin_Phone.txt"); InputStreamReader inputStreamReaderTc = new InputStreamReader(fileInputStreamTc); BufferedReader bufferedReaderTc = new BufferedReader(inputStreamReaderTc); StringBuilder stringBuilder = new StringBuilder(); while((recievedMessageTc = bufferedReaderTc.readLine())!=null){ stringBuilder.append(recievedMessageTc); } userPhone = stringBuilder.toString(); } catch (Exception e) { e.printStackTrace(); } } private void getUserInfo() { cm = (ConnectivityManager) requireActivity().getSystemService(Context.CONNECTIVITY_SERVICE); netInfo = cm.getActiveNetworkInfo(); if (netInfo != null && netInfo.isConnectedOrConnecting()) { try { databaseReference.child(userPhone).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { try { if(messageRole.equals("adminS")){ name.setText(Objects.requireNonNull(snapshot.child("username").getValue()).toString()); userEmailText = Objects.requireNonNull(snapshot.child("userEmail").getValue()).toString(); phone.setText(userPhone); email.setText(userEmailText); } else if(messageRole.equals("employeeS")){ name.setText(Objects.requireNonNull(snapshot.child("username").getValue()).toString()); userEmailText = Objects.requireNonNull(snapshot.child("userEmail").getValue()).toString(); userNid = Objects.requireNonNull(snapshot.child("userNid").getValue()).toString(); userAddress = Objects.requireNonNull(snapshot.child("userAddress").getValue()).toString(); phone.setText(userPhone); email.setText(userEmailText); nid.setText(userNid); address.setText(userAddress); } try { imageReference.child(userPhone).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { try { String imageUrl = Objects.requireNonNull(snapshot.child("avatar").getValue()).toString(); Picasso.get().load(imageUrl).into(profilePic); } catch (Exception e) { progressBar.setVisibility(View.GONE); } } @Override public void onCancelled(@NonNull DatabaseError error) {} }); } catch (Exception e) { progressBar.setVisibility(View.GONE); } progressBar.setVisibility(View.GONE); } catch (Exception exception){ progressBar.setVisibility(View.GONE); } } @Override public void onCancelled(@NonNull DatabaseError error) { progressBar.setVisibility(View.GONE); } }); } catch (Exception e){ Toast.makeText(getActivity(), "No Such User", Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.GONE); } } else { Toast.makeText(getActivity(), "Turn On Internet Connection", Toast.LENGTH_SHORT).show(); progressBar.setVisibility(View.GONE); } } @Override public void onClick(View v) { if(v.getId()==R.id.resetPassId) { Bundle armgs = new Bundle(); String emailText = email.getText().toString(); armgs.putString("email_key", emailText); ResetPassword resetPassword = new ResetPassword(); resetPassword.setArguments(armgs); resetPassword.show(requireActivity().getSupportFragmentManager(), "Sample dialog"); } if(v.getId()==R.id.uploadNidId) { Bundle armgs = new Bundle(); armgs.putString("email_key", email.getText().toString()); armgs.putString("phone_key", phone.getText().toString()); armgs.putString("username_key", name.getText().toString()); armgs.putString("nid_key", nid.getText().toString()); armgs.putString("address_key", address.getText().toString()); EditNid editNid = new EditNid(); editNid.setArguments(armgs); editNid.show(requireActivity().getSupportFragmentManager(), "Sample dialog"); } if(v.getId()==R.id.uploadAddressId) { Bundle armgs = new Bundle(); armgs.putString("email_key", email.getText().toString()); armgs.putString("phone_key", phone.getText().toString()); armgs.putString("username_key", name.getText().toString()); armgs.putString("nid_key", nid.getText().toString()); armgs.putString("address_key", address.getText().toString()); EditAddress editAddress = new EditAddress(); editAddress.setArguments(armgs); editAddress.show(requireActivity().getSupportFragmentManager(), "Sample dialog"); } if(v.getId()==R.id.logoutId) { logoutApp(); } if(v.getId()==R.id.backFromProfileId) { ((MainActivity) requireActivity()).bottomNavigationView.getMenu().setGroupCheckable(0, false, true); fragment = new Dashboard(); fragmentTransaction = requireActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragmentID, fragment, "EMPLOYEE_FRAGMENT"); fragmentTransaction.commit(); } if(v.getId()==R.id.uploadProfilePicId) { if (ContextCompat.checkSelfPermission(requireActivity(), Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED || ContextCompat.checkSelfPermission(requireActivity(), Manifest.permission.READ_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(requireActivity(), new String[]{ Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE}, PERMISSION_REQUEST_CODE); someActivityResultLauncher.launch("image/*"); } else { someActivityResultLauncher.launch("image/*"); } } } ActivityResultLauncher<String> someActivityResultLauncher = registerForActivityResult( new ActivityResultContracts.GetContent(), new ActivityResultCallback<Uri>() { @Override public void onActivityResult(Uri result) { if (result != null) { uriProfileImage = result; profilePic.setImageURI(uriProfileImage); Picasso.get().load(uriProfileImage).into(profilePic); uploadImageToFirebase(); } } }); private void uploadImageToFirebase() { dialog.setMessage("Uploading....."); dialog.show(); storageReference = FirebaseStorage.getInstance() .getReference("profile images/" + userPhone + ".jpg"); if(uriProfileImage!=null){ storageReference.putFile(uriProfileImage).addOnSuccessListener(taskSnapshot -> storageReference.getDownloadUrl().addOnSuccessListener(uri -> { profileImageUrl = uri.toString(); saveUserInfo(); }).addOnFailureListener(e -> { dialog.dismiss(); Toast.makeText(getActivity(), e.getMessage(), Toast.LENGTH_LONG).show(); })).addOnFailureListener(e -> {}); } } private void saveUserInfo() { FirebaseUser user = FirebaseAuth.getInstance().getCurrentUser(); if(user!=null && profileImageUrl!=null){ UserProfileChangeRequest profile; profile= new UserProfileChangeRequest.Builder() .setPhotoUri(Uri.parse(profileImageUrl)).build(); user.updateProfile(profile).addOnCompleteListener(task -> {}); storeImageMethod(profileImageUrl); dialog.dismiss(); Toast.makeText(getActivity(), "Successfully uploaded", Toast.LENGTH_SHORT).show(); } } public void storeImageMethod(String profileImageUrl){ StoreUserImageUrlData storeUserImageUrlData = new StoreUserImageUrlData(profileImageUrl); imageReference.child(userPhone).setValue(storeUserImageUrlData); } private void logoutApp(){ AlertDialog.Builder alertDialogBuilder; alertDialogBuilder = new AlertDialog.Builder(requireActivity()); alertDialogBuilder.setTitle("Logout !"); alertDialogBuilder.setMessage("Are you sure you want to logout ?"); alertDialogBuilder.setCancelable(false); alertDialogBuilder.setPositiveButton("Yes", (dialog, which) -> { String nullValue = ""; setNullMethod(nullValue); requireActivity().finish(); requireActivity().finishAffinity(); }); alertDialogBuilder.setNeutralButton("No", (dialog, which) -> dialog.cancel()); AlertDialog alertDialog = alertDialogBuilder.create(); alertDialog.show(); } private void setNullMethod(String passedString){ try { FileOutputStream fileOutputStream = requireActivity().openFileOutput("Users_Info.txt", Context.MODE_PRIVATE); fileOutputStream.write(passedString.getBytes()); fileOutputStream.close(); FileOutputStream fileOutputStream2 = requireActivity().openFileOutput("Admin_Phone.txt", Context.MODE_PRIVATE); fileOutputStream2.write(passedString.getBytes()); fileOutputStream2.close(); Intent intent = new Intent(getActivity(), LoginActivity.class); startActivity(intent); requireActivity().overridePendingTransition(R.anim.slide_in_left, R.anim.slide_out_right); } catch (Exception e) { e.printStackTrace(); } } @Override public void onBackPressed() { ((MainActivity) requireActivity()).bottomNavigationView.getMenu().setGroupCheckable(0, false, true); fragment = new Dashboard(); fragmentTransaction = requireActivity().getSupportFragmentManager().beginTransaction(); fragmentTransaction.replace(R.id.fragmentID, fragment, "EMPLOYEE_FRAGMENT"); fragmentTransaction.commit(); } @Override public void onResume() { super.onResume(); backBtnListener = this; } @Override public void onPause() { backBtnListener = null; super.onPause(); } }
/** * Copyright (c) 2013-2014, JCabi.com * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: 1) Redistributions of source code must retain the above * copyright notice, this list of conditions and the following * disclaimer. 2) Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. 3) Neither the name of the jcabi.com nor * the names of its contributors may be used to endorse or promote * products derived from this software without specific prior written * permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL * THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ package com.jcabi.github; import java.lang.reflect.InvocationHandler; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Proxy; import java.util.Iterator; import javax.json.JsonObject; import javax.validation.constraints.NotNull; import lombok.EqualsAndHashCode; /** * Bulk items, with pre-saved JSON. * * <p>This class should be used as a decorator for object obtained * from Github, when you want to keep their JSON values in memory. For * example: * * <pre> Iterable&lt;Issue&gt; issues = repo.issues().iterate( * new HashMap&lt;String, String&gt;() * ); * for (Issue issue : issues) { * System.out.println(new Issue.Smart(issue).title()); * }</pre> * * <p>Let's say, there are 50 issues in Github's repo. This code will * make 52 HTTP requests to Github. The first one will fetch the first * 30 issues in JSON array. Then, for every one of them, in order * to retrieve issue title a separate HTTP request will be made. Then, * one more page will be fetched, with 20 issues. And again, 20 new * HTTP requests to get their titles. * * <p>Class {@code Bulk} helps us to reduce the amount of this extra work: * * <pre> Iterable&lt;Issue&gt; issues = new Bulk&lt;Issue&gt;( * repo.issues().iterate( * new HashMap&lt;String, String&gt;() * ) * );</pre> * * <p>Now, there will be just two HTTP requests. * * @author Yegor Bugayenko (yegor@tpc2.com) * @version $Id$ * @since 0.4 * @param <T> Type of iterable objects * @see <a href="http://developer.github.com/v3/#pagination">Pagination</a> */ @EqualsAndHashCode(of = "origin") public final class Bulk<T extends JsonReadable> implements Iterable<T> { /** * Original iterable. */ private final transient Iterable<T> origin; /** * Public ctor. * @param items Items original * @checkstyle AnonInnerLength (50 lines) */ @SuppressWarnings("unchecked") public Bulk( @NotNull(message = "items can't be NULL") final Iterable<T> items ) { if (items instanceof RtPagination) { final RtPagination<T> page = RtPagination.class.cast(items); final RtPagination.Mapping<T, JsonObject> mapping = page.mapping(); this.origin = new RtPagination<T>( page.request(), new RtPagination.Mapping<T, JsonObject>() { @Override public T map(final JsonObject object) { final T item = mapping.map(object); return (T) Proxy.newProxyInstance( Thread.currentThread().getContextClassLoader(), item.getClass().getInterfaces(), new InvocationHandler() { @Override public Object invoke(final Object proxy, final Method method, final Object[] args) { final Object result; if ("json".equals(method.getName())) { result = object; } else { try { result = method.invoke(item, args); } catch (IllegalAccessException ex) { throw new IllegalStateException(ex); } catch (InvocationTargetException ex) { throw new IllegalStateException(ex); } } return result; } } ); } } ); } else { this.origin = items; } } @Override public String toString() { return this.origin.toString(); } @Override @NotNull(message = "iterator is never NULL") public Iterator<T> iterator() { return this.origin.iterator(); } }
package com.dimple.utils.web; import com.dimple.utils.StringUtils; import lombok.Data; /** * @className: PageDomain * @description: 分页数据 * @Version: 1.1 */ @Data public class PageDomain { /** * 当前记录起始索引 */ private Integer pageNum; /** * 每页显示记录数 */ private Integer pageSize; /** * 排序列 */ private String orderByColumn; /** * 排序的方向 "desc" 或者 "asc". */ private String isAsc; public String getOrderBy() { if (StringUtils.isEmpty(orderByColumn)) { return ""; } return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc; } }
package com.innominds.exception; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.ResponseStatus; @ResponseStatus(HttpStatus.NOT_FOUND) public class ResourceNotFoundException extends RuntimeException { private static final long serialVersionUID = 1L; public ResourceNotFoundException() {} public ResourceNotFoundException(String message) { super(message); } public ResourceNotFoundException(String message, Throwable cause) { super(message, cause); } }
/* * Copyright 2014-2018 Rudy De Busscher (https://www.atbash.be) * * 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 be.atbash.ee.security.octopus.authz.init; import be.atbash.ee.security.octopus.realm.mgmt.RoleMapperProvider; import java.util.Iterator; import java.util.ServiceLoader; /** * Loads a {@code LookupProvider} through the serviceLoader mechanism or returns the fallback loader. */ public class RoleMapperProviderLoader { public <T extends Enum<T>> RoleMapperProvider<T> loadRoleMapperProvider() { Iterator<RoleMapperProvider> providerIterator = ServiceLoader.load(RoleMapperProvider.class).iterator(); if (providerIterator.hasNext()) { return providerIterator.next(); // TODO What if there are multiple defined? } else { return new FallbackRoleMapperProvider(); } } }
// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package org.chromium.android_webview; import android.content.Context; import android.os.StrictMode; import org.chromium.android_webview.policy.AwPolicyProvider; import org.chromium.base.CommandLine; import org.chromium.base.ContextUtils; import org.chromium.base.Log; import org.chromium.base.PathUtils; import org.chromium.base.ThreadUtils; import org.chromium.base.library_loader.LibraryLoader; import org.chromium.base.library_loader.LibraryProcessType; import org.chromium.base.library_loader.ProcessInitException; import org.chromium.content.browser.BrowserStartupController; import org.chromium.content.browser.ChildProcessCreationParams; import org.chromium.policy.CombinedPolicyProvider; import java.io.File; import java.io.IOException; import java.io.RandomAccessFile; import java.nio.channels.FileLock; /** * Wrapper for the steps needed to initialize the java and native sides of webview chromium. */ public abstract class AwBrowserProcess { public static final String PRIVATE_DATA_DIRECTORY_SUFFIX = "webview"; private static final String TAG = "AwBrowserProcess"; private static final String EXCLUSIVE_LOCK_FILE = "webview_data.lock"; private static FileLock sExclusiveFileLock; /** * Loads the native library, and performs basic static construction of objects needed * to run webview in this process. Does not create threads; safe to call from zygote. * Note: it is up to the caller to ensure this is only called once. */ public static void loadLibrary() { Context appContext = ContextUtils.getApplicationContext(); PathUtils.setPrivateDataDirectorySuffix(PRIVATE_DATA_DIRECTORY_SUFFIX, appContext); try { LibraryLoader libraryLoader = LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW); libraryLoader.loadNow(appContext); // Switch the command line implementation from Java to native. // It's okay for the WebView to do this before initialization because we have // setup the JNI bindings by this point. libraryLoader.switchCommandLineForWebView(); } catch (ProcessInitException e) { throw new RuntimeException("Cannot load WebView", e); } } /** * Configures child process launcher. This is required only if child services are used in * WebView. */ public static void configureChildProcessLauncher(String packageName, int extraBindFlags) { ChildProcessCreationParams.set( new ChildProcessCreationParams(packageName, extraBindFlags, LibraryProcessType.PROCESS_WEBVIEW_CHILD)); } /** * Starts the chromium browser process running within this process. Creates threads * and performs other per-app resource allocations; must not be called from zygote. * Note: it is up to the caller to ensure this is only called once. */ public static void start() { tryObtainingDataDirLockOrDie(); // We must post to the UI thread to cover the case that the user // has invoked Chromium startup by using the (thread-safe) // CookieManager rather than creating a WebView. ThreadUtils.runOnUiThreadBlocking(new Runnable() { @Override public void run() { Context appContext = ContextUtils.getApplicationContext(); // The policies are used by browser startup, so we need to register the policy // providers before starting the browser process. This only registers java objects // and doesn't need the native library. CombinedPolicyProvider.get().registerProvider(new AwPolicyProvider(appContext)); try { BrowserStartupController.get(appContext, LibraryProcessType.PROCESS_WEBVIEW) .startBrowserProcessesSync(!CommandLine.getInstance().hasSwitch( AwSwitches.WEBVIEW_SANDBOXED_RENDERER)); } catch (ProcessInitException e) { throw new RuntimeException("Cannot initialize WebView", e); } } }); } private static void tryObtainingDataDirLockOrDie() { StrictMode.ThreadPolicy oldPolicy = StrictMode.allowThreadDiskReads(); StrictMode.allowThreadDiskWrites(); try { String dataPath = PathUtils.getDataDirectory(ContextUtils.getApplicationContext()); File lockFile = new File(dataPath, EXCLUSIVE_LOCK_FILE); boolean success = false; try { // Note that the file is not closed intentionally. RandomAccessFile file = new RandomAccessFile(lockFile, "rw"); sExclusiveFileLock = file.getChannel().tryLock(); success = sExclusiveFileLock != null; } catch (IOException e) { Log.w(TAG, "Failed to create lock file " + lockFile, e); } if (!success) { Log.w(TAG, "The app may have another WebView opened in a separate process. " + "This is not recommended and may stop working in future versions."); } } finally { StrictMode.setThreadPolicy(oldPolicy); } } }
package seedu.address.logic.commands; import static java.util.Objects.requireNonNull; import java.util.Arrays; import java.util.List; import seedu.address.commons.core.Messages; import seedu.address.commons.core.index.Index; import seedu.address.logic.commands.exceptions.CommandException; import seedu.address.model.Model; import seedu.address.model.task.Task; /** * Deletes a task identified using it's displayed index from PlaNus. */ public class DeleteTaskCommand extends Command { public static final String COMMAND_WORD = "delete-task"; public static final String MESSAGE_USAGE = COMMAND_WORD + ": Deletes the task identified by the index number used in the displayed task list.\n" + "Parameters: INDEX (must be a positive integer)\n" + "Example: " + COMMAND_WORD + " 1"; public static final String MESSAGE_DELETE_TASK_SUCCESS = "Deleted Task: %1$s"; private final Index[] targetIndexes; /** * Creates an DeleteTaskCommand to to delete the tasks with {@code targetIndexes} from system. */ public DeleteTaskCommand(Index[] targetIndexes) { requireNonNull(targetIndexes); this.targetIndexes = targetIndexes; } @Override public CommandResult execute(Model model) throws CommandException { requireNonNull(model); List<Task> lastShownList = model.getFilteredTaskList(); Task[] tasksToDelete = checkIndexValidity(targetIndexes, lastShownList, Messages.MESSAGE_INVALID_TASKS_DISPLAYED_INDEX) .toArray(new Task[0]); model.deleteTask(tasksToDelete); for (Task task : tasksToDelete) { if (model.hasCalendarTask(task)) { model.deleteTaskInCalendar(new Task[]{task}); } } return new CommandResult(buildMessage(tasksToDelete)); } /** * @param tasks that is been deleted. * returns message built by the list of tasks deleted. */ public static String buildMessage(Task[] tasks) { StringBuilder message = new StringBuilder(); for (Task task : tasks) { message.append(String.format(MESSAGE_DELETE_TASK_SUCCESS, task.getTitle())).append("\n"); } return message.toString(); } @Override public boolean equals(Object other) { return other == this // short circuit if same object || (other instanceof DeleteTaskCommand // instanceof handles nulls && Arrays.equals(targetIndexes, ((DeleteTaskCommand) other).targetIndexes)); // state check } }
/* * Copyright (c) 2015, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.asm.sparc.SPARCAssembler; import org.graalvm.compiler.core.common.LIRKind; import org.graalvm.compiler.graph.NodeClass; import org.graalvm.compiler.lir.sparc.SPARCImmediateAddressValue; import org.graalvm.compiler.nodeinfo.NodeInfo; import org.graalvm.compiler.nodes.NodeView; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.memory.address.AddressNode; import org.graalvm.compiler.nodes.spi.LIRLowerable; import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; import jdk.vm.ci.meta.AllocatableValue; /** * Represents an address of the form [base + simm13]. */ @NodeInfo public class SPARCImmediateAddressNode extends AddressNode implements LIRLowerable { public static final NodeClass<SPARCImmediateAddressNode> TYPE = NodeClass.create(SPARCImmediateAddressNode.class); @Input private ValueNode base; private int displacement; public SPARCImmediateAddressNode(ValueNode base, int displacement) { super(TYPE); assert SPARCAssembler.isSimm13(displacement); this.base = base; this.displacement = displacement; } @Override public void generate(NodeLIRBuilderTool gen) { SPARCLIRGenerator tool = (SPARCLIRGenerator) gen.getLIRGeneratorTool(); AllocatableValue baseValue = tool.asAllocatable(gen.operand(base)); LIRKind kind = tool.getLIRKind(stamp(NodeView.DEFAULT)); AllocatableValue baseReference = LIRKind.derivedBaseFromValue(baseValue); if (baseReference != null) { kind = kind.makeDerivedReference(baseReference); } gen.setResult(this, new SPARCImmediateAddressValue(kind, baseValue, displacement)); } @Override public ValueNode getBase() { return base; } @Override public long getMaxConstantDisplacement() { return displacement; } @Override public ValueNode getIndex() { return null; } }
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.mycompany.escolar.servlet; import com.google.gson.Gson; import com.mycompany.escolar.dao.DBDAO; import com.mycompany.escolar.vo.Cuentas; import java.io.IOException; import java.io.PrintWriter; import java.util.List; //import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; /** * * @author phabian */ @WebServlet(name = "MiLogin", urlPatterns = {"/MiLogin"}) public class MiLogin extends HttpServlet { /** * Processes requests for both HTTP <code>GET</code> and <code>POST</code> * methods. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { Cuentas c; try (PrintWriter out = response.getWriter()) { List<Cuentas> list = DBDAO.getCuentas("SELECT * FROM Cuentas WHERE nick='"+ request.getParameter("userName") + "' and password ='"+ request.getParameter("userPassword")+"';"); if(list.size() > 0){ c = list.get(0); System.out.println("Encontrado"); response.setContentType("application/json"); String json = new Gson().toJson(c); response.getWriter().write(json); } else{ System.out.println("NOEncontrado"); response.setContentType("text/plain"); response.getWriter().write("encontrado"); } } } // <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code."> /** * Handles the HTTP <code>GET</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Handles the HTTP <code>POST</code> method. * * @param request servlet request * @param response servlet response * @throws ServletException if a servlet-specific error occurs * @throws IOException if an I/O error occurs */ @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); } /** * Returns a short description of the servlet. * * @return a String containing servlet description */ @Override public String getServletInfo() { return "Short description"; }// </editor-fold> }
package module440packageJava0; import java.lang.Integer; public class Foo5 { Integer int0; Integer int1; public void foo0() { new module440packageJava0.Foo4().foo3(); } public void foo1() { foo0(); } public void foo2() { foo1(); } public void foo3() { foo2(); } }
/** * Copyright (c) 2017-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ package com.facebook.litho.specmodels.generator; import javax.lang.model.element.Modifier; import java.util.Locale; import com.facebook.litho.annotations.Param; import com.facebook.litho.specmodels.model.MethodParamModel; import com.facebook.litho.specmodels.model.MethodParamModelUtils; import com.facebook.litho.specmodels.model.ClassNames; import com.facebook.litho.specmodels.model.SpecModel; import com.facebook.litho.specmodels.model.StateParamModel; import com.facebook.litho.specmodels.model.UpdateStateMethodModel; import com.squareup.javapoet.ClassName; import com.squareup.javapoet.CodeBlock; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterSpec; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import static com.facebook.litho.specmodels.generator.GeneratorConstants.DELEGATE_FIELD_NAME; import static com.facebook.litho.specmodels.generator.GeneratorConstants.SPEC_INSTANCE_NAME; import static com.facebook.litho.specmodels.generator.GeneratorConstants.STATE_CONTAINER_FIELD_NAME; /** * Class that generates the state methods for a Component. */ public class StateGenerator { private static final String STATE_UPDATE_IMPL_NAME_SUFFIX = "StateUpdate"; private static final String STATE_CONTAINER_PARAM_NAME = "stateContainer"; private static final String STATE_CONTAINER_IMPL_NAME = "stateContainerImpl"; private static final String STATE_UPDATE_NEW_COMPONENT_NAME = "newComponent"; private static final String STATE_UPDATE_METHOD_NAME = "updateState"; private static final String LAZY_STATE_UPDATE_VALUE_PARAM = "lazyUpdateValue"; private static final String STATE_UPDATE_IS_LAZY_METHOD_NAME = "isLazyStateUpdate"; private StateGenerator() { } public static TypeSpecDataHolder generate(SpecModel specModel) { return TypeSpecDataHolder.newBuilder() .addTypeSpecDataHolder(generateHasState(specModel)) .addTypeSpecDataHolder(generateTransferState(specModel)) .addTypeSpecDataHolder(generateOnStateUpdateMethods(specModel)) .addTypeSpecDataHolder(generateStateUpdateClasses(specModel)) .addTypeSpecDataHolder(generateLazyStateUpdateMethods(specModel)) .build(); } static TypeSpecDataHolder generateHasState(SpecModel specModel) { final TypeSpecDataHolder.Builder typeSpecDataHolder = TypeSpecDataHolder.newBuilder(); if (!specModel.getStateValues().isEmpty()) { typeSpecDataHolder.addMethod( MethodSpec.methodBuilder("hasState") .addAnnotation(Override.class) .addModifiers(Modifier.PROTECTED) .returns(TypeName.BOOLEAN) .addStatement("return true") .build()); } return typeSpecDataHolder.build(); } static TypeSpecDataHolder generateTransferState(SpecModel specModel) { if (specModel.getStateValues().isEmpty()) { return TypeSpecDataHolder.newBuilder().build(); } MethodSpec.Builder methodSpec = MethodSpec.methodBuilder("transferState") .addAnnotation(Override.class) .addModifiers(Modifier.PROTECTED) .addParameter(ParameterSpec.builder(specModel.getContextClass(), "context").build()) .addParameter( ParameterSpec.builder(specModel.getStateContainerClass(), "prevStateContainer").build()) .addParameter(ParameterSpec.builder(specModel.getComponentClass(), "component").build()) .addStatement( "$L prevStateContainerImpl = ($L) prevStateContainer", ComponentImplGenerator.getStateContainerImplClassName(specModel), ComponentImplGenerator.getStateContainerImplClassName(specModel)) .addStatement( "$L componentImpl = ($L) component", ComponentImplGenerator.getImplClassName(specModel), ComponentImplGenerator.getImplClassName(specModel)); for (StateParamModel stateValue : specModel.getStateValues()) { methodSpec.addStatement( "componentImpl.$L.$L = prevStateContainerImpl.$L", STATE_CONTAINER_FIELD_NAME, stateValue.getName(), stateValue.getName()); } return TypeSpecDataHolder.newBuilder().addMethod(methodSpec.build()).build(); } static TypeSpecDataHolder generateStateUpdateClasses(SpecModel specModel) { TypeSpecDataHolder.Builder dataHolder = TypeSpecDataHolder.newBuilder(); for (UpdateStateMethodModel updateStateMethod : specModel.getUpdateStateMethods()) { dataHolder.addTypeSpecDataHolder(generateStateUpdateClass(specModel, updateStateMethod)); } return dataHolder.build(); } static TypeSpecDataHolder generateOnStateUpdateMethods(SpecModel specModel) { TypeSpecDataHolder.Builder dataHolder = TypeSpecDataHolder.newBuilder(); for (UpdateStateMethodModel updateStateMethod : specModel.getUpdateStateMethods()) { dataHolder.addTypeSpecDataHolder(generateOnStateUpdateMethod(specModel, updateStateMethod, true)); dataHolder.addTypeSpecDataHolder(generateOnStateUpdateMethod(specModel, updateStateMethod, false)); } return dataHolder.build(); } static TypeSpecDataHolder generateOnStateUpdateMethod( SpecModel specModel, UpdateStateMethodModel updateStateMethod, boolean isAsync) { final String name = isAsync ? updateStateMethod.name.toString() + "Async" : updateStateMethod.name.toString(); final MethodSpec.Builder builder = MethodSpec.methodBuilder(name) .addModifiers(Modifier.PROTECTED, Modifier.STATIC) .addParameter(specModel.getContextClass(), "c"); builder.addStatement( "$T _component = c.get$LScope()", specModel.getComponentClass(), specModel.getComponentClass().simpleName()) .addCode( CodeBlock.builder() .beginControlFlow("if (_component == null)") .addStatement("return") .endControlFlow() .build()); final CodeBlock.Builder codeBlockBuilder = CodeBlock.builder(); codeBlockBuilder.add(specModel.getComponentName() + "." + getStateUpdateClassName(updateStateMethod) + " _stateUpdate = ((" + specModel.getComponentName() +"."+ specModel.getComponentName() + "Impl) _component).create" + getStateUpdateClassName(updateStateMethod) + "("); boolean isFirstParam = true; for (MethodParamModel methodParam : updateStateMethod.methodParams) { if (MethodParamModelUtils.isAnnotatedWith(methodParam, Param.class)) { if (!isFirstParam) { codeBlockBuilder.add(", "); } else { isFirstParam = false; } builder.addParameter(methodParam.getType(), methodParam.getName()); builder.addTypeVariables(MethodParamModelUtils.getTypeVariables(methodParam)); codeBlockBuilder.add(methodParam.getName()); } } codeBlockBuilder.add(");\n"); builder.addCode(codeBlockBuilder.build()); if (isAsync) { builder.addStatement("c.updateStateAsync(_stateUpdate)"); } else { builder.addStatement("c.updateState(_stateUpdate)"); } return TypeSpecDataHolder.newBuilder().addMethod(builder.build()).build(); } static TypeSpecDataHolder generateStateUpdateClass( SpecModel specModel, UpdateStateMethodModel updateStateMethod) { final TypeSpec.Builder stateUpdateClassBuilder = TypeSpec.classBuilder(getStateUpdateClassName(updateStateMethod)) .addModifiers(Modifier.PRIVATE) .addSuperinterface(specModel.getUpdateStateInterface()); if (!specModel.hasInjectedDependencies()) { stateUpdateClassBuilder.addModifiers(Modifier.STATIC); } // Generate updateState method. final String newComponentImplName = STATE_UPDATE_NEW_COMPONENT_NAME + STATE_UPDATE_IMPL_NAME_SUFFIX; MethodSpec.Builder updateStateMethodBuilder = MethodSpec.methodBuilder(STATE_UPDATE_METHOD_NAME) .addModifiers(Modifier.PUBLIC) .addParameter(specModel.getStateContainerClass(), STATE_CONTAINER_PARAM_NAME) .addParameter(specModel.getComponentClass(), STATE_UPDATE_NEW_COMPONENT_NAME) .addStatement( "$L $L = ($L) $L", ComponentImplGenerator.getStateContainerImplClassName(specModel), STATE_CONTAINER_IMPL_NAME, ComponentImplGenerator.getStateContainerImplClassName(specModel), STATE_CONTAINER_PARAM_NAME) .addStatement( "$L $L = ($L) $L", ComponentImplGenerator.getImplClassName(specModel), newComponentImplName, ComponentImplGenerator.getImplClassName(specModel), STATE_UPDATE_NEW_COMPONENT_NAME); // Add constructor and member fields. MethodSpec.Builder constructor = MethodSpec.constructorBuilder(); for (MethodParamModel methodParam : updateStateMethod.methodParams) { if (MethodParamModelUtils.isAnnotatedWith(methodParam, Param.class)) { stateUpdateClassBuilder.addField( methodParam.getType(), getMemberName(methodParam), Modifier.PRIVATE); constructor .addParameter(methodParam.getType(), methodParam.getName()) .addStatement("$L = $L", getMemberName(methodParam), methodParam.getName()); if (!specModel.hasInjectedDependencies()) { stateUpdateClassBuilder.addTypeVariables( MethodParamModelUtils.getTypeVariables(methodParam)); } } else { // Must be a StateValue<>. updateStateMethodBuilder .addStatement( "$T $L = new $T()", methodParam.getType(), methodParam.getName(), methodParam.getType()) .addStatement( "$L.set($L.$L)", methodParam.getName(), STATE_CONTAINER_IMPL_NAME, methodParam.getName()); } } final String target = !specModel.hasInjectedDependencies() ? SPEC_INSTANCE_NAME + "." + DELEGATE_FIELD_NAME : DELEGATE_FIELD_NAME + specModel.getDependencyInjectionHelper().getSourceDelegateAccessorMethod(specModel); // Call the spec's update method. updateStateMethodBuilder.addStatement( target + "." + updateStateMethod.name + "(" + getParamsForSpecUpdateMethodCall(updateStateMethod) + ")"); // Set the new value of the state. for (MethodParamModel methodParamModel : updateStateMethod.methodParams) { if (!MethodParamModelUtils.isAnnotatedWith(methodParamModel, Param.class)) { updateStateMethodBuilder .addStatement( newComponentImplName + "." + STATE_CONTAINER_FIELD_NAME + "." + methodParamModel.getName() + " = " + methodParamModel.getName() + ".get()"); } } return TypeSpecDataHolder.newBuilder() .addType(stateUpdateClassBuilder .addMethod(constructor.build()) .addMethod(updateStateMethodBuilder.build()) .addMethod(MethodSpec.methodBuilder(STATE_UPDATE_IS_LAZY_METHOD_NAME) .addModifiers(Modifier.PUBLIC) .returns(TypeName.BOOLEAN) .addStatement("return false") .build()) .build()) .build(); } static TypeSpecDataHolder generateLazyStateUpdateMethods(SpecModel specModel) { TypeSpecDataHolder.Builder dataHolder = TypeSpecDataHolder.newBuilder(); for (StateParamModel stateValue : specModel.getStateValues()) { if (stateValue.canUpdateLazily()) { dataHolder.addTypeSpecDataHolder(generateLazyStateUpdateMethod(specModel, stateValue)); } } return dataHolder.build(); } static TypeSpecDataHolder generateLazyStateUpdateMethod( SpecModel specModel, StateParamModel stateValue) { final String newComponentImplName = STATE_UPDATE_NEW_COMPONENT_NAME + STATE_UPDATE_IMPL_NAME_SUFFIX; final MethodSpec.Builder builder = MethodSpec.methodBuilder( "lazyUpdate" + stateValue.getName().substring(0, 1).toUpperCase(Locale.ROOT) + stateValue.getName().substring(1)) .addModifiers(Modifier.PROTECTED, Modifier.STATIC) .addParameter(specModel.getContextClass(), "c") .addParameter(stateValue.getType(), LAZY_STATE_UPDATE_VALUE_PARAM, Modifier.FINAL); builder.addStatement( "$T _component = c.get$LScope()", specModel.getComponentClass(), specModel.getComponentClass().simpleName()) .addCode( CodeBlock.builder() .beginControlFlow("if (_component == null)") .addStatement("return") .endControlFlow() .build()); final TypeName implClass = ClassName.bestGuess( specModel.getComponentName() + "." + ComponentImplGenerator.getImplClassName(specModel)); final MethodSpec.Builder stateUpdate = MethodSpec.methodBuilder(STATE_UPDATE_METHOD_NAME) .addParameter(specModel.getStateContainerClass(), STATE_CONTAINER_PARAM_NAME) .addParameter(specModel.getComponentClass(), STATE_UPDATE_NEW_COMPONENT_NAME) .addModifiers(Modifier.PUBLIC) .addStatement( "$T $L = ($T) $L", implClass, newComponentImplName, implClass, STATE_UPDATE_NEW_COMPONENT_NAME) .addStatement( "$T $L = new $T()", ParameterizedTypeName.get(ClassNames.STATE_VALUE, stateValue.getType().box()), stateValue.getName(), ParameterizedTypeName.get(ClassNames.STATE_VALUE, stateValue.getType().box())) .addStatement(stateValue.getName() + ".set(" + LAZY_STATE_UPDATE_VALUE_PARAM + ")") .addStatement( "$L.$L.$L = $L.get()", newComponentImplName, GeneratorConstants.STATE_CONTAINER_FIELD_NAME, stateValue.getName(), stateValue.getName()); final TypeSpec.Builder stateBuilderImpl = TypeSpec.anonymousClassBuilder("") .addSuperinterface(specModel.getUpdateStateInterface()) .addMethod(stateUpdate.build()) .addMethod(MethodSpec.methodBuilder(STATE_UPDATE_IS_LAZY_METHOD_NAME) .addModifiers(Modifier.PUBLIC) .returns(TypeName.BOOLEAN) .addStatement("return true") .build()); builder.addStatement( "$T _stateUpdate = $L", specModel.getUpdateStateInterface(), stateBuilderImpl.build()); builder.addStatement("c.updateStateLazy(_stateUpdate)"); return TypeSpecDataHolder.newBuilder().addMethod(builder.build()).build(); } private static String getStateUpdateClassName(UpdateStateMethodModel updateMethod) { String methodName = updateMethod.name.toString(); return methodName.substring(0, 1).toUpperCase(Locale.ROOT) + methodName.substring(1) + STATE_UPDATE_IMPL_NAME_SUFFIX; } private static String getMemberName(MethodParamModel methodParamModel) { return "m" + methodParamModel.getName().substring(0, 1).toUpperCase() + methodParamModel.getName().substring(1); } private static String getParamsForSpecUpdateMethodCall(UpdateStateMethodModel updateStateMethod) { StringBuilder sb = new StringBuilder(); for (int i = 0, size = updateStateMethod.methodParams.size(); i < size; i++) { MethodParamModel methodParam = updateStateMethod.methodParams.get(i); if (MethodParamModelUtils.isAnnotatedWith(methodParam, Param.class)) { sb.append(getMemberName(methodParam)); } else { sb.append(methodParam.getName()); } if (i < size - 1) { sb.append(','); } } return sb.toString(); } }
/* * This file is part of choco-solver, http://choco-solver.org/ * * Copyright (c) 2020, IMT Atlantique. All rights reserved. * * Licensed under the BSD 4-clause license. * * See LICENSE file in the project root for full license information. */ package org.chocosolver.solver.constraints.extension.nary; import org.chocosolver.solver.constraints.extension.Tuples; import org.chocosolver.solver.exception.SolverException; import org.chocosolver.solver.variables.IntVar; import java.util.Arrays; import java.util.Comparator; /** * A simple way of storing the tuples as a list. This doesn't allow * consistency check (TuplesTable is made for that) * or iteration over supports of each value (IterTuplesTable is made for that) * This simple way of storing supports only allow fast iteration over the all * set of tuples and is used by STR gac scheme. */ public class TuplesList extends LargeRelation { // each tuple (a int[]) has its own index protected final int[][] tuplesIndexes; protected static final Comparator<int[]> TCOMP = (o1, o2) -> { int n = o1.length; int i = 0; while (i < n && o1[i] == o2[i]) i++; if (i == n) return 0; if (o1[i] < o2[i]) return -1; return 1; }; // required for duplicate method, should not be called by default TuplesList(int[][] tuplesIndexes) { this.tuplesIndexes = tuplesIndexes; Arrays.sort(tuplesIndexes, TCOMP); } public TuplesList(Tuples tuples, IntVar[] vars) { int nb = tuples.nbTuples(); int[][] _tuplesIndexes = new int[nb][]; int k = 0; for (int i = 0; i < nb; i++) { int[] tuple = tuples.get(i); if (valid(tuple, vars)) { _tuplesIndexes[k++] = tuple; } } tuplesIndexes = new int[k][]; System.arraycopy(_tuplesIndexes, 0, tuplesIndexes, 0, k); Arrays.sort(tuplesIndexes, TCOMP); } public int[] getTuple(int support) { return tuplesIndexes[support]; } public int[][] getTupleTable() { return tuplesIndexes; } public boolean checkTuple(int[] tuple) { throw new SolverException("TuplesList is an unusual large relation..."); } public boolean isConsistent(int[] tuple) { return Arrays.binarySearch(tuplesIndexes, tuple, TCOMP) >= 0; } @Override public Tuples convert() { Tuples tuples = new Tuples(true); for(int[] t: tuplesIndexes){ tuples.add(t); } return tuples; } }
/* AUTO-GENERATED FILE. DO NOT MODIFY. * * This class was automatically generated by the * aapt tool from the resource data it found. It * should not be modified by hand. */ package com.wada811.android.material.design.colors; public final class R { public static final class anim { public static final int abc_fade_in = 0x7f050000; public static final int abc_fade_out = 0x7f050001; public static final int abc_grow_fade_in_from_bottom = 0x7f050002; public static final int abc_popup_enter = 0x7f050003; public static final int abc_popup_exit = 0x7f050004; public static final int abc_shrink_fade_out_from_bottom = 0x7f050005; public static final int abc_slide_in_bottom = 0x7f050006; public static final int abc_slide_in_top = 0x7f050007; public static final int abc_slide_out_bottom = 0x7f050008; public static final int abc_slide_out_top = 0x7f050009; } public static final class attr { public static final int actionBarDivider = 0x7f010042; public static final int actionBarItemBackground = 0x7f010043; public static final int actionBarPopupTheme = 0x7f01003c; public static final int actionBarSize = 0x7f010041; public static final int actionBarSplitStyle = 0x7f01003e; public static final int actionBarStyle = 0x7f01003d; public static final int actionBarTabBarStyle = 0x7f010038; public static final int actionBarTabStyle = 0x7f010037; public static final int actionBarTabTextStyle = 0x7f010039; public static final int actionBarTheme = 0x7f01003f; public static final int actionBarWidgetTheme = 0x7f010040; public static final int actionButtonStyle = 0x7f01005d; public static final int actionDropDownStyle = 0x7f010059; public static final int actionLayout = 0x7f0100db; public static final int actionMenuTextAppearance = 0x7f010044; public static final int actionMenuTextColor = 0x7f010045; public static final int actionModeBackground = 0x7f010048; public static final int actionModeCloseButtonStyle = 0x7f010047; public static final int actionModeCloseDrawable = 0x7f01004a; public static final int actionModeCopyDrawable = 0x7f01004c; public static final int actionModeCutDrawable = 0x7f01004b; public static final int actionModeFindDrawable = 0x7f010050; public static final int actionModePasteDrawable = 0x7f01004d; public static final int actionModePopupWindowStyle = 0x7f010052; public static final int actionModeSelectAllDrawable = 0x7f01004e; public static final int actionModeShareDrawable = 0x7f01004f; public static final int actionModeSplitBackground = 0x7f010049; public static final int actionModeStyle = 0x7f010046; public static final int actionModeWebSearchDrawable = 0x7f010051; public static final int actionOverflowButtonStyle = 0x7f01003a; public static final int actionOverflowMenuStyle = 0x7f01003b; public static final int actionProviderClass = 0x7f0100dd; public static final int actionViewClass = 0x7f0100dc; public static final int activityChooserViewStyle = 0x7f010065; public static final int alertDialogButtonGroupStyle = 0x7f010089; public static final int alertDialogCenterButtons = 0x7f01008a; public static final int alertDialogStyle = 0x7f010088; public static final int alertDialogTheme = 0x7f01008b; public static final int allowStacking = 0x7f01009f; public static final int arrowHeadLength = 0x7f0100d0; public static final int arrowShaftLength = 0x7f0100d1; public static final int autoCompleteTextViewStyle = 0x7f010090; public static final int background = 0x7f01000c; public static final int backgroundSplit = 0x7f01000e; public static final int backgroundStacked = 0x7f01000d; public static final int backgroundTint = 0x7f010116; public static final int backgroundTintMode = 0x7f010117; public static final int barLength = 0x7f0100d2; public static final int borderlessButtonStyle = 0x7f010062; public static final int buttonBarButtonStyle = 0x7f01005f; public static final int buttonBarNegativeButtonStyle = 0x7f01008e; public static final int buttonBarNeutralButtonStyle = 0x7f01008f; public static final int buttonBarPositiveButtonStyle = 0x7f01008d; public static final int buttonBarStyle = 0x7f01005e; public static final int buttonPanelSideLayout = 0x7f010023; public static final int buttonStyle = 0x7f010091; public static final int buttonStyleSmall = 0x7f010092; public static final int buttonTint = 0x7f0100bc; public static final int buttonTintMode = 0x7f0100bd; public static final int checkboxStyle = 0x7f010093; public static final int checkedTextViewStyle = 0x7f010094; public static final int closeIcon = 0x7f0100eb; public static final int closeItemLayout = 0x7f010020; public static final int collapseContentDescription = 0x7f01010d; public static final int collapseIcon = 0x7f01010c; public static final int color = 0x7f0100cc; public static final int colorAccent = 0x7f010080; public static final int colorButtonNormal = 0x7f010084; public static final int colorControlActivated = 0x7f010082; public static final int colorControlHighlight = 0x7f010083; public static final int colorControlNormal = 0x7f010081; public static final int colorPrimary = 0x7f01007e; public static final int colorPrimaryDark = 0x7f01007f; public static final int colorSwitchThumbNormal = 0x7f010085; public static final int commitIcon = 0x7f0100f0; public static final int contentInsetEnd = 0x7f010017; public static final int contentInsetLeft = 0x7f010018; public static final int contentInsetRight = 0x7f010019; public static final int contentInsetStart = 0x7f010016; public static final int controlBackground = 0x7f010086; public static final int customNavigationLayout = 0x7f01000f; public static final int defaultQueryHint = 0x7f0100ea; public static final int dialogPreferredPadding = 0x7f010057; public static final int dialogTheme = 0x7f010056; public static final int displayOptions = 0x7f010005; public static final int divider = 0x7f01000b; public static final int dividerHorizontal = 0x7f010064; public static final int dividerPadding = 0x7f0100d6; public static final int dividerVertical = 0x7f010063; public static final int drawableSize = 0x7f0100ce; public static final int drawerArrowStyle = 0x7f010000; public static final int dropDownListViewStyle = 0x7f010076; public static final int dropdownListPreferredItemHeight = 0x7f01005a; public static final int editTextBackground = 0x7f01006b; public static final int editTextColor = 0x7f01006a; public static final int editTextStyle = 0x7f010095; public static final int elevation = 0x7f01001c; public static final int expandActivityOverflowButtonDrawable = 0x7f010022; public static final int gapBetweenBars = 0x7f0100cf; public static final int goIcon = 0x7f0100ec; public static final int height = 0x7f010001; public static final int hideOnContentScroll = 0x7f010015; public static final int homeAsUpIndicator = 0x7f01005c; public static final int homeLayout = 0x7f010010; public static final int icon = 0x7f010009; public static final int iconifiedByDefault = 0x7f0100e8; public static final int imageButtonStyle = 0x7f01006c; public static final int indeterminateProgressStyle = 0x7f010012; public static final int initialActivityCount = 0x7f010021; public static final int isLightTheme = 0x7f010002; public static final int itemPadding = 0x7f010014; public static final int layout = 0x7f0100e7; public static final int listChoiceBackgroundIndicator = 0x7f01007d; public static final int listDividerAlertDialog = 0x7f010058; public static final int listItemLayout = 0x7f010027; public static final int listLayout = 0x7f010024; public static final int listPopupWindowStyle = 0x7f010077; public static final int listPreferredItemHeight = 0x7f010071; public static final int listPreferredItemHeightLarge = 0x7f010073; public static final int listPreferredItemHeightSmall = 0x7f010072; public static final int listPreferredItemPaddingLeft = 0x7f010074; public static final int listPreferredItemPaddingRight = 0x7f010075; public static final int logo = 0x7f01000a; public static final int logoDescription = 0x7f010110; public static final int maxButtonHeight = 0x7f01010a; public static final int measureWithLargestChild = 0x7f0100d4; public static final int multiChoiceItemLayout = 0x7f010025; public static final int navigationContentDescription = 0x7f01010f; public static final int navigationIcon = 0x7f01010e; public static final int navigationMode = 0x7f010004; public static final int overlapAnchor = 0x7f0100e0; public static final int paddingEnd = 0x7f010114; public static final int paddingStart = 0x7f010113; public static final int panelBackground = 0x7f01007a; public static final int panelMenuListTheme = 0x7f01007c; public static final int panelMenuListWidth = 0x7f01007b; public static final int popupMenuStyle = 0x7f010068; public static final int popupTheme = 0x7f01001d; public static final int popupWindowStyle = 0x7f010069; public static final int preserveIconSpacing = 0x7f0100de; public static final int progressBarPadding = 0x7f010013; public static final int progressBarStyle = 0x7f010011; public static final int queryBackground = 0x7f0100f2; public static final int queryHint = 0x7f0100e9; public static final int radioButtonStyle = 0x7f010096; public static final int ratingBarStyle = 0x7f010097; public static final int ratingBarStyleIndicator = 0x7f010098; public static final int ratingBarStyleSmall = 0x7f010099; public static final int searchHintIcon = 0x7f0100ee; public static final int searchIcon = 0x7f0100ed; public static final int searchViewStyle = 0x7f010070; public static final int seekBarStyle = 0x7f01009a; public static final int selectableItemBackground = 0x7f010060; public static final int selectableItemBackgroundBorderless = 0x7f010061; public static final int showAsAction = 0x7f0100da; public static final int showDividers = 0x7f0100d5; public static final int showText = 0x7f010101; public static final int singleChoiceItemLayout = 0x7f010026; public static final int spinBars = 0x7f0100cd; public static final int spinnerDropDownItemStyle = 0x7f01005b; public static final int spinnerStyle = 0x7f01009b; public static final int splitTrack = 0x7f010100; public static final int srcCompat = 0x7f010028; public static final int state_above_anchor = 0x7f0100e1; public static final int submitBackground = 0x7f0100f3; public static final int subtitle = 0x7f010006; public static final int subtitleTextAppearance = 0x7f010103; public static final int subtitleTextColor = 0x7f010112; public static final int subtitleTextStyle = 0x7f010008; public static final int suggestionRowLayout = 0x7f0100f1; public static final int switchMinWidth = 0x7f0100fe; public static final int switchPadding = 0x7f0100ff; public static final int switchStyle = 0x7f01009c; public static final int switchTextAppearance = 0x7f0100fd; public static final int textAllCaps = 0x7f01002c; public static final int textAppearanceLargePopupMenu = 0x7f010053; public static final int textAppearanceListItem = 0x7f010078; public static final int textAppearanceListItemSmall = 0x7f010079; public static final int textAppearanceSearchResultSubtitle = 0x7f01006e; public static final int textAppearanceSearchResultTitle = 0x7f01006d; public static final int textAppearanceSmallPopupMenu = 0x7f010054; public static final int textColorAlertDialogListItem = 0x7f01008c; public static final int textColorSearchUrl = 0x7f01006f; public static final int theme = 0x7f010115; public static final int thickness = 0x7f0100d3; public static final int thumbTextPadding = 0x7f0100fc; public static final int title = 0x7f010003; public static final int titleMarginBottom = 0x7f010108; public static final int titleMarginEnd = 0x7f010106; public static final int titleMarginStart = 0x7f010105; public static final int titleMarginTop = 0x7f010107; public static final int titleMargins = 0x7f010109; public static final int titleTextAppearance = 0x7f010102; public static final int titleTextColor = 0x7f010111; public static final int titleTextStyle = 0x7f010007; public static final int toolbarNavigationButtonStyle = 0x7f010067; public static final int toolbarStyle = 0x7f010066; public static final int track = 0x7f0100f9; public static final int voiceIcon = 0x7f0100ef; public static final int windowActionBar = 0x7f01002d; public static final int windowActionBarOverlay = 0x7f01002f; public static final int windowActionModeOverlay = 0x7f010030; public static final int windowFixedHeightMajor = 0x7f010034; public static final int windowFixedHeightMinor = 0x7f010032; public static final int windowFixedWidthMajor = 0x7f010031; public static final int windowFixedWidthMinor = 0x7f010033; public static final int windowMinWidthMajor = 0x7f010035; public static final int windowMinWidthMinor = 0x7f010036; public static final int windowNoTitle = 0x7f01002e; } public static final class bool { public static final int abc_action_bar_embed_tabs = 0x7f0b0000; public static final int abc_allow_stacked_button_bar = 0x7f0b0001; public static final int abc_config_actionMenuItemAllCaps = 0x7f0b0002; public static final int abc_config_closeDialogWhenTouchOutside = 0x7f0b0003; public static final int abc_config_showMenuShortcutsWhenKeyboardPresent = 0x7f0b0004; } public static final class color { public static final int abc_background_cache_hint_selector_material_dark = 0x7f0c0164; public static final int abc_background_cache_hint_selector_material_light = 0x7f0c0165; public static final int abc_color_highlight_material = 0x7f0c0167; public static final int abc_input_method_navigation_guard = 0x7f0c0001; public static final int abc_primary_text_disable_only_material_dark = 0x7f0c016a; public static final int abc_primary_text_disable_only_material_light = 0x7f0c016b; public static final int abc_primary_text_material_dark = 0x7f0c016c; public static final int abc_primary_text_material_light = 0x7f0c016d; public static final int abc_search_url_text = 0x7f0c016e; public static final int abc_search_url_text_normal = 0x7f0c0002; public static final int abc_search_url_text_pressed = 0x7f0c0003; public static final int abc_search_url_text_selected = 0x7f0c0004; public static final int abc_secondary_text_material_dark = 0x7f0c016f; public static final int abc_secondary_text_material_light = 0x7f0c0170; public static final int accent_material_dark = 0x7f0c0005; public static final int accent_material_light = 0x7f0c0006; public static final int background_floating_material_dark = 0x7f0c0009; public static final int background_floating_material_light = 0x7f0c000a; public static final int background_material_dark = 0x7f0c000b; public static final int background_material_light = 0x7f0c000c; public static final int bright_foreground_disabled_material_dark = 0x7f0c0011; public static final int bright_foreground_disabled_material_light = 0x7f0c0012; public static final int bright_foreground_inverse_material_dark = 0x7f0c0013; public static final int bright_foreground_inverse_material_light = 0x7f0c0014; public static final int bright_foreground_material_dark = 0x7f0c0015; public static final int bright_foreground_material_light = 0x7f0c0016; public static final int button_material_dark = 0x7f0c0017; public static final int button_material_light = 0x7f0c0018; public static final int dim_foreground_disabled_material_dark = 0x7f0c002e; public static final int dim_foreground_disabled_material_light = 0x7f0c002f; public static final int dim_foreground_material_dark = 0x7f0c0030; public static final int dim_foreground_material_light = 0x7f0c0031; public static final int foreground_material_dark = 0x7f0c0036; public static final int foreground_material_light = 0x7f0c0037; public static final int highlighted_text_material_dark = 0x7f0c003a; public static final int highlighted_text_material_light = 0x7f0c003b; public static final int material_blue_grey_800 = 0x7f0c003d; public static final int material_blue_grey_900 = 0x7f0c003e; public static final int material_blue_grey_950 = 0x7f0c003f; public static final int material_deep_teal_200 = 0x7f0c0040; public static final int material_deep_teal_500 = 0x7f0c0041; public static final int material_grey_100 = 0x7f0c0042; public static final int material_grey_300 = 0x7f0c0043; public static final int material_grey_50 = 0x7f0c0044; public static final int material_grey_600 = 0x7f0c0045; public static final int material_grey_800 = 0x7f0c0046; public static final int material_grey_850 = 0x7f0c0047; public static final int material_grey_900 = 0x7f0c0048; public static final int md_amber_100 = 0x7f0c0049; public static final int md_amber_200 = 0x7f0c004a; public static final int md_amber_300 = 0x7f0c004b; public static final int md_amber_400 = 0x7f0c004c; public static final int md_amber_50 = 0x7f0c004d; public static final int md_amber_500 = 0x7f0c004e; public static final int md_amber_600 = 0x7f0c004f; public static final int md_amber_700 = 0x7f0c0050; public static final int md_amber_800 = 0x7f0c0051; public static final int md_amber_900 = 0x7f0c0052; public static final int md_amber_a100 = 0x7f0c0053; public static final int md_amber_a200 = 0x7f0c0054; public static final int md_amber_a400 = 0x7f0c0055; public static final int md_amber_a700 = 0x7f0c0056; public static final int md_black = 0x7f0c0057; public static final int md_blue_100 = 0x7f0c0058; public static final int md_blue_200 = 0x7f0c0059; public static final int md_blue_300 = 0x7f0c005a; public static final int md_blue_400 = 0x7f0c005b; public static final int md_blue_50 = 0x7f0c005c; public static final int md_blue_500 = 0x7f0c005d; public static final int md_blue_600 = 0x7f0c005e; public static final int md_blue_700 = 0x7f0c005f; public static final int md_blue_800 = 0x7f0c0060; public static final int md_blue_900 = 0x7f0c0061; public static final int md_blue_a100 = 0x7f0c0062; public static final int md_blue_a200 = 0x7f0c0063; public static final int md_blue_a400 = 0x7f0c0064; public static final int md_blue_a700 = 0x7f0c0065; public static final int md_blue_grey_100 = 0x7f0c0066; public static final int md_blue_grey_200 = 0x7f0c0067; public static final int md_blue_grey_300 = 0x7f0c0068; public static final int md_blue_grey_400 = 0x7f0c0069; public static final int md_blue_grey_50 = 0x7f0c006a; public static final int md_blue_grey_500 = 0x7f0c006b; public static final int md_blue_grey_600 = 0x7f0c006c; public static final int md_blue_grey_700 = 0x7f0c006d; public static final int md_blue_grey_800 = 0x7f0c006e; public static final int md_blue_grey_900 = 0x7f0c006f; public static final int md_brown_100 = 0x7f0c0070; public static final int md_brown_200 = 0x7f0c0071; public static final int md_brown_300 = 0x7f0c0072; public static final int md_brown_400 = 0x7f0c0073; public static final int md_brown_50 = 0x7f0c0074; public static final int md_brown_500 = 0x7f0c0075; public static final int md_brown_600 = 0x7f0c0076; public static final int md_brown_700 = 0x7f0c0077; public static final int md_brown_800 = 0x7f0c0078; public static final int md_brown_900 = 0x7f0c0079; public static final int md_cyan_100 = 0x7f0c007a; public static final int md_cyan_200 = 0x7f0c007b; public static final int md_cyan_300 = 0x7f0c007c; public static final int md_cyan_400 = 0x7f0c007d; public static final int md_cyan_50 = 0x7f0c007e; public static final int md_cyan_500 = 0x7f0c007f; public static final int md_cyan_600 = 0x7f0c0080; public static final int md_cyan_700 = 0x7f0c0081; public static final int md_cyan_800 = 0x7f0c0082; public static final int md_cyan_900 = 0x7f0c0083; public static final int md_cyan_a100 = 0x7f0c0084; public static final int md_cyan_a200 = 0x7f0c0085; public static final int md_cyan_a400 = 0x7f0c0086; public static final int md_cyan_a700 = 0x7f0c0087; public static final int md_deep_orange_100 = 0x7f0c0088; public static final int md_deep_orange_200 = 0x7f0c0089; public static final int md_deep_orange_300 = 0x7f0c008a; public static final int md_deep_orange_400 = 0x7f0c008b; public static final int md_deep_orange_50 = 0x7f0c008c; public static final int md_deep_orange_500 = 0x7f0c008d; public static final int md_deep_orange_600 = 0x7f0c008e; public static final int md_deep_orange_700 = 0x7f0c008f; public static final int md_deep_orange_800 = 0x7f0c0090; public static final int md_deep_orange_900 = 0x7f0c0091; public static final int md_deep_orange_a100 = 0x7f0c0092; public static final int md_deep_orange_a200 = 0x7f0c0093; public static final int md_deep_orange_a400 = 0x7f0c0094; public static final int md_deep_orange_a700 = 0x7f0c0095; public static final int md_deep_purple_100 = 0x7f0c0096; public static final int md_deep_purple_200 = 0x7f0c0097; public static final int md_deep_purple_300 = 0x7f0c0098; public static final int md_deep_purple_400 = 0x7f0c0099; public static final int md_deep_purple_50 = 0x7f0c009a; public static final int md_deep_purple_500 = 0x7f0c009b; public static final int md_deep_purple_600 = 0x7f0c009c; public static final int md_deep_purple_700 = 0x7f0c009d; public static final int md_deep_purple_800 = 0x7f0c009e; public static final int md_deep_purple_900 = 0x7f0c009f; public static final int md_deep_purple_a100 = 0x7f0c00a0; public static final int md_deep_purple_a200 = 0x7f0c00a1; public static final int md_deep_purple_a400 = 0x7f0c00a2; public static final int md_deep_purple_a700 = 0x7f0c00a3; public static final int md_green_100 = 0x7f0c00a4; public static final int md_green_200 = 0x7f0c00a5; public static final int md_green_300 = 0x7f0c00a6; public static final int md_green_400 = 0x7f0c00a7; public static final int md_green_50 = 0x7f0c00a8; public static final int md_green_500 = 0x7f0c00a9; public static final int md_green_600 = 0x7f0c00aa; public static final int md_green_700 = 0x7f0c00ab; public static final int md_green_800 = 0x7f0c00ac; public static final int md_green_900 = 0x7f0c00ad; public static final int md_green_a100 = 0x7f0c00ae; public static final int md_green_a200 = 0x7f0c00af; public static final int md_green_a400 = 0x7f0c00b0; public static final int md_green_a700 = 0x7f0c00b1; public static final int md_grey_100 = 0x7f0c00b2; public static final int md_grey_200 = 0x7f0c00b3; public static final int md_grey_300 = 0x7f0c00b4; public static final int md_grey_400 = 0x7f0c00b5; public static final int md_grey_50 = 0x7f0c00b6; public static final int md_grey_500 = 0x7f0c00b7; public static final int md_grey_600 = 0x7f0c00b8; public static final int md_grey_700 = 0x7f0c00b9; public static final int md_grey_800 = 0x7f0c00ba; public static final int md_grey_900 = 0x7f0c00bb; public static final int md_indigo_100 = 0x7f0c00bc; public static final int md_indigo_200 = 0x7f0c00bd; public static final int md_indigo_300 = 0x7f0c00be; public static final int md_indigo_400 = 0x7f0c00bf; public static final int md_indigo_50 = 0x7f0c00c0; public static final int md_indigo_500 = 0x7f0c00c1; public static final int md_indigo_600 = 0x7f0c00c2; public static final int md_indigo_700 = 0x7f0c00c3; public static final int md_indigo_800 = 0x7f0c00c4; public static final int md_indigo_900 = 0x7f0c00c5; public static final int md_indigo_a100 = 0x7f0c00c6; public static final int md_indigo_a200 = 0x7f0c00c7; public static final int md_indigo_a400 = 0x7f0c00c8; public static final int md_indigo_a700 = 0x7f0c00c9; public static final int md_light_blue_100 = 0x7f0c00ca; public static final int md_light_blue_200 = 0x7f0c00cb; public static final int md_light_blue_300 = 0x7f0c00cc; public static final int md_light_blue_400 = 0x7f0c00cd; public static final int md_light_blue_50 = 0x7f0c00ce; public static final int md_light_blue_500 = 0x7f0c00cf; public static final int md_light_blue_600 = 0x7f0c00d0; public static final int md_light_blue_700 = 0x7f0c00d1; public static final int md_light_blue_800 = 0x7f0c00d2; public static final int md_light_blue_900 = 0x7f0c00d3; public static final int md_light_blue_a100 = 0x7f0c00d4; public static final int md_light_blue_a200 = 0x7f0c00d5; public static final int md_light_blue_a400 = 0x7f0c00d6; public static final int md_light_blue_a700 = 0x7f0c00d7; public static final int md_light_green_100 = 0x7f0c00d8; public static final int md_light_green_200 = 0x7f0c00d9; public static final int md_light_green_300 = 0x7f0c00da; public static final int md_light_green_400 = 0x7f0c00db; public static final int md_light_green_50 = 0x7f0c00dc; public static final int md_light_green_500 = 0x7f0c00dd; public static final int md_light_green_600 = 0x7f0c00de; public static final int md_light_green_700 = 0x7f0c00df; public static final int md_light_green_800 = 0x7f0c00e0; public static final int md_light_green_900 = 0x7f0c00e1; public static final int md_light_green_a100 = 0x7f0c00e2; public static final int md_light_green_a200 = 0x7f0c00e3; public static final int md_light_green_a400 = 0x7f0c00e4; public static final int md_light_green_a700 = 0x7f0c00e5; public static final int md_lime_100 = 0x7f0c00e6; public static final int md_lime_200 = 0x7f0c00e7; public static final int md_lime_300 = 0x7f0c00e8; public static final int md_lime_400 = 0x7f0c00e9; public static final int md_lime_50 = 0x7f0c00ea; public static final int md_lime_500 = 0x7f0c00eb; public static final int md_lime_600 = 0x7f0c00ec; public static final int md_lime_700 = 0x7f0c00ed; public static final int md_lime_800 = 0x7f0c00ee; public static final int md_lime_900 = 0x7f0c00ef; public static final int md_lime_a100 = 0x7f0c00f0; public static final int md_lime_a200 = 0x7f0c00f1; public static final int md_lime_a400 = 0x7f0c00f2; public static final int md_lime_a700 = 0x7f0c00f3; public static final int md_orange_100 = 0x7f0c00f4; public static final int md_orange_200 = 0x7f0c00f5; public static final int md_orange_300 = 0x7f0c00f6; public static final int md_orange_400 = 0x7f0c00f7; public static final int md_orange_50 = 0x7f0c00f8; public static final int md_orange_500 = 0x7f0c00f9; public static final int md_orange_600 = 0x7f0c00fa; public static final int md_orange_700 = 0x7f0c00fb; public static final int md_orange_800 = 0x7f0c00fc; public static final int md_orange_900 = 0x7f0c00fd; public static final int md_orange_a100 = 0x7f0c00fe; public static final int md_orange_a200 = 0x7f0c00ff; public static final int md_orange_a400 = 0x7f0c0100; public static final int md_orange_a700 = 0x7f0c0101; public static final int md_pink_100 = 0x7f0c0102; public static final int md_pink_200 = 0x7f0c0103; public static final int md_pink_300 = 0x7f0c0104; public static final int md_pink_400 = 0x7f0c0105; public static final int md_pink_50 = 0x7f0c0106; public static final int md_pink_500 = 0x7f0c0107; public static final int md_pink_600 = 0x7f0c0108; public static final int md_pink_700 = 0x7f0c0109; public static final int md_pink_800 = 0x7f0c010a; public static final int md_pink_900 = 0x7f0c010b; public static final int md_pink_a100 = 0x7f0c010c; public static final int md_pink_a200 = 0x7f0c010d; public static final int md_pink_a400 = 0x7f0c010e; public static final int md_pink_a700 = 0x7f0c010f; public static final int md_purple_100 = 0x7f0c0110; public static final int md_purple_200 = 0x7f0c0111; public static final int md_purple_300 = 0x7f0c0112; public static final int md_purple_400 = 0x7f0c0113; public static final int md_purple_50 = 0x7f0c0114; public static final int md_purple_500 = 0x7f0c0115; public static final int md_purple_600 = 0x7f0c0116; public static final int md_purple_700 = 0x7f0c0117; public static final int md_purple_800 = 0x7f0c0118; public static final int md_purple_900 = 0x7f0c0119; public static final int md_purple_a100 = 0x7f0c011a; public static final int md_purple_a200 = 0x7f0c011b; public static final int md_purple_a400 = 0x7f0c011c; public static final int md_purple_a700 = 0x7f0c011d; public static final int md_red_100 = 0x7f0c011e; public static final int md_red_200 = 0x7f0c011f; public static final int md_red_300 = 0x7f0c0120; public static final int md_red_400 = 0x7f0c0121; public static final int md_red_50 = 0x7f0c0122; public static final int md_red_500 = 0x7f0c0123; public static final int md_red_600 = 0x7f0c0124; public static final int md_red_700 = 0x7f0c0125; public static final int md_red_800 = 0x7f0c0126; public static final int md_red_900 = 0x7f0c0127; public static final int md_red_a100 = 0x7f0c0128; public static final int md_red_a200 = 0x7f0c0129; public static final int md_red_a400 = 0x7f0c012a; public static final int md_red_a700 = 0x7f0c012b; public static final int md_teal_100 = 0x7f0c012c; public static final int md_teal_200 = 0x7f0c012d; public static final int md_teal_300 = 0x7f0c012e; public static final int md_teal_400 = 0x7f0c012f; public static final int md_teal_50 = 0x7f0c0130; public static final int md_teal_500 = 0x7f0c0131; public static final int md_teal_600 = 0x7f0c0132; public static final int md_teal_700 = 0x7f0c0133; public static final int md_teal_800 = 0x7f0c0134; public static final int md_teal_900 = 0x7f0c0135; public static final int md_teal_a100 = 0x7f0c0136; public static final int md_teal_a200 = 0x7f0c0137; public static final int md_teal_a400 = 0x7f0c0138; public static final int md_teal_a700 = 0x7f0c0139; public static final int md_white = 0x7f0c013a; public static final int md_yellow_100 = 0x7f0c013b; public static final int md_yellow_200 = 0x7f0c013c; public static final int md_yellow_300 = 0x7f0c013d; public static final int md_yellow_400 = 0x7f0c013e; public static final int md_yellow_50 = 0x7f0c013f; public static final int md_yellow_500 = 0x7f0c0140; public static final int md_yellow_600 = 0x7f0c0141; public static final int md_yellow_700 = 0x7f0c0142; public static final int md_yellow_800 = 0x7f0c0143; public static final int md_yellow_900 = 0x7f0c0144; public static final int md_yellow_a100 = 0x7f0c0145; public static final int md_yellow_a200 = 0x7f0c0146; public static final int md_yellow_a400 = 0x7f0c0147; public static final int md_yellow_a700 = 0x7f0c0148; public static final int primary_dark_material_dark = 0x7f0c014c; public static final int primary_dark_material_light = 0x7f0c014d; public static final int primary_material_dark = 0x7f0c014e; public static final int primary_material_light = 0x7f0c014f; public static final int primary_text_default_material_dark = 0x7f0c0151; public static final int primary_text_default_material_light = 0x7f0c0152; public static final int primary_text_disabled_material_dark = 0x7f0c0153; public static final int primary_text_disabled_material_light = 0x7f0c0154; public static final int ripple_material_dark = 0x7f0c0157; public static final int ripple_material_light = 0x7f0c0158; public static final int secondary_text_default_material_dark = 0x7f0c0159; public static final int secondary_text_default_material_light = 0x7f0c015a; public static final int secondary_text_disabled_material_dark = 0x7f0c015b; public static final int secondary_text_disabled_material_light = 0x7f0c015c; public static final int switch_thumb_disabled_material_dark = 0x7f0c015f; public static final int switch_thumb_disabled_material_light = 0x7f0c0160; public static final int switch_thumb_material_dark = 0x7f0c017d; public static final int switch_thumb_material_light = 0x7f0c017e; public static final int switch_thumb_normal_material_dark = 0x7f0c0161; public static final int switch_thumb_normal_material_light = 0x7f0c0162; } public static final class dimen { public static final int abc_action_bar_content_inset_material = 0x7f09000c; public static final int abc_action_bar_default_height_material = 0x7f090001; public static final int abc_action_bar_default_padding_end_material = 0x7f09000e; public static final int abc_action_bar_default_padding_start_material = 0x7f09000f; public static final int abc_action_bar_icon_vertical_padding_material = 0x7f090019; public static final int abc_action_bar_overflow_padding_end_material = 0x7f09001a; public static final int abc_action_bar_overflow_padding_start_material = 0x7f09001b; public static final int abc_action_bar_progress_bar_size = 0x7f090002; public static final int abc_action_bar_stacked_max_height = 0x7f09001c; public static final int abc_action_bar_stacked_tab_max_width = 0x7f09001d; public static final int abc_action_bar_subtitle_bottom_margin_material = 0x7f09001e; public static final int abc_action_bar_subtitle_top_margin_material = 0x7f09001f; public static final int abc_action_button_min_height_material = 0x7f090020; public static final int abc_action_button_min_width_material = 0x7f090021; public static final int abc_action_button_min_width_overflow_material = 0x7f090022; public static final int abc_alert_dialog_button_bar_height = 0x7f090000; public static final int abc_button_inset_horizontal_material = 0x7f090023; public static final int abc_button_inset_vertical_material = 0x7f090024; public static final int abc_button_padding_horizontal_material = 0x7f090025; public static final int abc_button_padding_vertical_material = 0x7f090026; public static final int abc_config_prefDialogWidth = 0x7f090005; public static final int abc_control_corner_material = 0x7f090028; public static final int abc_control_inset_material = 0x7f090029; public static final int abc_control_padding_material = 0x7f09002a; public static final int abc_dialog_fixed_height_major = 0x7f090006; public static final int abc_dialog_fixed_height_minor = 0x7f090007; public static final int abc_dialog_fixed_width_major = 0x7f090008; public static final int abc_dialog_fixed_width_minor = 0x7f090009; public static final int abc_dialog_list_padding_vertical_material = 0x7f09002b; public static final int abc_dialog_min_width_major = 0x7f09000a; public static final int abc_dialog_min_width_minor = 0x7f09000b; public static final int abc_dialog_padding_material = 0x7f09002c; public static final int abc_dialog_padding_top_material = 0x7f09002d; public static final int abc_disabled_alpha_material_dark = 0x7f09002e; public static final int abc_disabled_alpha_material_light = 0x7f09002f; public static final int abc_dropdownitem_icon_width = 0x7f090030; public static final int abc_dropdownitem_text_padding_left = 0x7f090031; public static final int abc_dropdownitem_text_padding_right = 0x7f090032; public static final int abc_edit_text_inset_bottom_material = 0x7f090033; public static final int abc_edit_text_inset_horizontal_material = 0x7f090034; public static final int abc_edit_text_inset_top_material = 0x7f090035; public static final int abc_floating_window_z = 0x7f090036; public static final int abc_list_item_padding_horizontal_material = 0x7f090037; public static final int abc_panel_menu_list_width = 0x7f090038; public static final int abc_search_view_preferred_width = 0x7f09003b; public static final int abc_seekbar_track_background_height_material = 0x7f09003c; public static final int abc_seekbar_track_progress_height_material = 0x7f09003d; public static final int abc_select_dialog_padding_start_material = 0x7f09003e; public static final int abc_switch_padding = 0x7f090013; public static final int abc_text_size_body_1_material = 0x7f09003f; public static final int abc_text_size_body_2_material = 0x7f090040; public static final int abc_text_size_button_material = 0x7f090041; public static final int abc_text_size_caption_material = 0x7f090042; public static final int abc_text_size_display_1_material = 0x7f090043; public static final int abc_text_size_display_2_material = 0x7f090044; public static final int abc_text_size_display_3_material = 0x7f090045; public static final int abc_text_size_display_4_material = 0x7f090046; public static final int abc_text_size_headline_material = 0x7f090047; public static final int abc_text_size_large_material = 0x7f090048; public static final int abc_text_size_medium_material = 0x7f090049; public static final int abc_text_size_menu_material = 0x7f09004b; public static final int abc_text_size_small_material = 0x7f09004c; public static final int abc_text_size_subhead_material = 0x7f09004d; public static final int abc_text_size_subtitle_material_toolbar = 0x7f090003; public static final int abc_text_size_title_material = 0x7f09004e; public static final int abc_text_size_title_material_toolbar = 0x7f090004; public static final int disabled_alpha_material_dark = 0x7f09006a; public static final int disabled_alpha_material_light = 0x7f09006b; public static final int highlight_alpha_material_colored = 0x7f09006d; public static final int highlight_alpha_material_dark = 0x7f09006e; public static final int highlight_alpha_material_light = 0x7f09006f; public static final int notification_large_icon_height = 0x7f09007d; public static final int notification_large_icon_width = 0x7f09007e; public static final int notification_subtext_size = 0x7f090082; } public static final class drawable { public static final int abc_ab_share_pack_mtrl_alpha = 0x7f020000; public static final int abc_action_bar_item_background_material = 0x7f020001; public static final int abc_btn_borderless_material = 0x7f020002; public static final int abc_btn_check_material = 0x7f020003; public static final int abc_btn_check_to_on_mtrl_000 = 0x7f020004; public static final int abc_btn_check_to_on_mtrl_015 = 0x7f020005; public static final int abc_btn_colored_material = 0x7f020006; public static final int abc_btn_default_mtrl_shape = 0x7f020007; public static final int abc_btn_radio_material = 0x7f020008; public static final int abc_btn_radio_to_on_mtrl_000 = 0x7f020009; public static final int abc_btn_radio_to_on_mtrl_015 = 0x7f02000a; public static final int abc_btn_switch_to_on_mtrl_00001 = 0x7f02000b; public static final int abc_btn_switch_to_on_mtrl_00012 = 0x7f02000c; public static final int abc_cab_background_internal_bg = 0x7f02000d; public static final int abc_cab_background_top_material = 0x7f02000e; public static final int abc_cab_background_top_mtrl_alpha = 0x7f02000f; public static final int abc_control_background_material = 0x7f020010; public static final int abc_edit_text_material = 0x7f020012; public static final int abc_ic_commit_search_api_mtrl_alpha = 0x7f020016; public static final int abc_ic_menu_copy_mtrl_am_alpha = 0x7f020018; public static final int abc_ic_menu_cut_mtrl_alpha = 0x7f020019; public static final int abc_ic_menu_paste_mtrl_am_alpha = 0x7f02001b; public static final int abc_ic_menu_selectall_mtrl_alpha = 0x7f02001c; public static final int abc_ic_menu_share_mtrl_alpha = 0x7f02001d; public static final int abc_ic_star_black_16dp = 0x7f02001f; public static final int abc_ic_star_black_36dp = 0x7f020020; public static final int abc_ic_star_half_black_16dp = 0x7f020022; public static final int abc_ic_star_half_black_36dp = 0x7f020023; public static final int abc_item_background_holo_dark = 0x7f020026; public static final int abc_item_background_holo_light = 0x7f020027; public static final int abc_list_divider_mtrl_alpha = 0x7f020028; public static final int abc_list_focused_holo = 0x7f020029; public static final int abc_list_longpressed_holo = 0x7f02002a; public static final int abc_list_pressed_holo_dark = 0x7f02002b; public static final int abc_list_pressed_holo_light = 0x7f02002c; public static final int abc_list_selector_background_transition_holo_dark = 0x7f02002d; public static final int abc_list_selector_background_transition_holo_light = 0x7f02002e; public static final int abc_list_selector_disabled_holo_dark = 0x7f02002f; public static final int abc_list_selector_disabled_holo_light = 0x7f020030; public static final int abc_list_selector_holo_dark = 0x7f020031; public static final int abc_list_selector_holo_light = 0x7f020032; public static final int abc_menu_hardkey_panel_mtrl_mult = 0x7f020033; public static final int abc_popup_background_mtrl_mult = 0x7f020034; public static final int abc_ratingbar_indicator_material = 0x7f020035; public static final int abc_ratingbar_small_material = 0x7f020037; public static final int abc_scrubber_control_off_mtrl_alpha = 0x7f020038; public static final int abc_scrubber_control_to_pressed_mtrl_000 = 0x7f020039; public static final int abc_scrubber_control_to_pressed_mtrl_005 = 0x7f02003a; public static final int abc_scrubber_primary_mtrl_alpha = 0x7f02003b; public static final int abc_scrubber_track_mtrl_alpha = 0x7f02003c; public static final int abc_seekbar_thumb_material = 0x7f02003d; public static final int abc_seekbar_track_material = 0x7f02003f; public static final int abc_spinner_mtrl_am_alpha = 0x7f020040; public static final int abc_spinner_textfield_background_material = 0x7f020041; public static final int abc_switch_thumb_material = 0x7f020042; public static final int abc_switch_track_mtrl_alpha = 0x7f020043; public static final int abc_tab_indicator_material = 0x7f020044; public static final int abc_tab_indicator_mtrl_alpha = 0x7f020045; public static final int abc_text_cursor_material = 0x7f020046; public static final int abc_textfield_activated_mtrl_alpha = 0x7f02004d; public static final int abc_textfield_default_mtrl_alpha = 0x7f02004e; public static final int abc_textfield_search_activated_mtrl_alpha = 0x7f02004f; public static final int abc_textfield_search_default_mtrl_alpha = 0x7f020050; public static final int abc_textfield_search_material = 0x7f020051; public static final int notification_template_icon_bg = 0x7f02007e; } public static final class id { public static final int action0 = 0x7f0e0078; public static final int action_bar = 0x7f0e005d; public static final int action_bar_activity_content = 0x7f0e0000; public static final int action_bar_container = 0x7f0e005c; public static final int action_bar_root = 0x7f0e0058; public static final int action_bar_spinner = 0x7f0e0001; public static final int action_bar_subtitle = 0x7f0e003d; public static final int action_bar_title = 0x7f0e003c; public static final int action_context_bar = 0x7f0e005e; public static final int action_divider = 0x7f0e007c; public static final int action_menu_divider = 0x7f0e0002; public static final int action_menu_presenter = 0x7f0e0003; public static final int action_mode_bar = 0x7f0e005a; public static final int action_mode_bar_stub = 0x7f0e0059; public static final int action_mode_close_button = 0x7f0e003e; public static final int activity_chooser_view_content = 0x7f0e003f; public static final int alertTitle = 0x7f0e004b; public static final int always = 0x7f0e0029; public static final int beginning = 0x7f0e0024; public static final int buttonPanel = 0x7f0e0046; public static final int cancel_action = 0x7f0e0079; public static final int checkbox = 0x7f0e0054; public static final int chronometer = 0x7f0e0081; public static final int collapseActionView = 0x7f0e002a; public static final int contentPanel = 0x7f0e004c; public static final int custom = 0x7f0e0052; public static final int customPanel = 0x7f0e0051; public static final int decor_content_parent = 0x7f0e005b; public static final int default_activity_button = 0x7f0e0042; public static final int disableHome = 0x7f0e000d; public static final int edit_query = 0x7f0e005f; public static final int end = 0x7f0e0025; public static final int end_padder = 0x7f0e008b; public static final int expand_activities_button = 0x7f0e0040; public static final int expanded_menu = 0x7f0e0053; public static final int home = 0x7f0e0004; public static final int homeAsUp = 0x7f0e000e; public static final int icon = 0x7f0e0044; public static final int ifRoom = 0x7f0e002b; public static final int image = 0x7f0e0041; public static final int info = 0x7f0e0082; public static final int line1 = 0x7f0e0087; public static final int line3 = 0x7f0e0089; public static final int listMode = 0x7f0e000a; public static final int list_item = 0x7f0e0043; public static final int media_actions = 0x7f0e007b; public static final int middle = 0x7f0e0026; public static final int multiply = 0x7f0e0015; public static final int never = 0x7f0e002c; public static final int none = 0x7f0e000f; public static final int normal = 0x7f0e000b; public static final int parentPanel = 0x7f0e0048; public static final int progress_circular = 0x7f0e0006; public static final int progress_horizontal = 0x7f0e0007; public static final int radio = 0x7f0e0056; public static final int screen = 0x7f0e0016; public static final int scrollIndicatorDown = 0x7f0e0050; public static final int scrollIndicatorUp = 0x7f0e004d; public static final int scrollView = 0x7f0e004e; public static final int search_badge = 0x7f0e0061; public static final int search_bar = 0x7f0e0060; public static final int search_button = 0x7f0e0062; public static final int search_close_btn = 0x7f0e0067; public static final int search_edit_frame = 0x7f0e0063; public static final int search_go_btn = 0x7f0e0069; public static final int search_mag_icon = 0x7f0e0064; public static final int search_plate = 0x7f0e0065; public static final int search_src_text = 0x7f0e0066; public static final int search_voice_btn = 0x7f0e006a; public static final int select_dialog_listview = 0x7f0e006b; public static final int shortcut = 0x7f0e0055; public static final int showCustom = 0x7f0e0010; public static final int showHome = 0x7f0e0011; public static final int showTitle = 0x7f0e0012; public static final int spacer = 0x7f0e0047; public static final int split_action_bar = 0x7f0e0008; public static final int src_atop = 0x7f0e0017; public static final int src_in = 0x7f0e0018; public static final int src_over = 0x7f0e0019; public static final int status_bar_latest_event_content = 0x7f0e007a; public static final int submit_area = 0x7f0e0068; public static final int tabMode = 0x7f0e000c; public static final int text = 0x7f0e008a; public static final int text2 = 0x7f0e0088; public static final int textSpacerNoButtons = 0x7f0e004f; public static final int time = 0x7f0e0080; public static final int title = 0x7f0e0045; public static final int title_template = 0x7f0e004a; public static final int topPanel = 0x7f0e0049; public static final int up = 0x7f0e0009; public static final int useLogo = 0x7f0e0013; public static final int withText = 0x7f0e002d; public static final int wrap_content = 0x7f0e001a; } public static final class integer { public static final int abc_config_activityDefaultDur = 0x7f0f0000; public static final int abc_config_activityShortDur = 0x7f0f0001; public static final int cancel_button_image_alpha = 0x7f0f0006; public static final int status_bar_notification_info_maxnum = 0x7f0f0008; } public static final class layout { public static final int abc_action_bar_title_item = 0x7f040000; public static final int abc_action_bar_up_container = 0x7f040001; public static final int abc_action_bar_view_list_nav_layout = 0x7f040002; public static final int abc_action_menu_item_layout = 0x7f040003; public static final int abc_action_menu_layout = 0x7f040004; public static final int abc_action_mode_bar = 0x7f040005; public static final int abc_action_mode_close_item_material = 0x7f040006; public static final int abc_activity_chooser_view = 0x7f040007; public static final int abc_activity_chooser_view_list_item = 0x7f040008; public static final int abc_alert_dialog_button_bar_material = 0x7f040009; public static final int abc_alert_dialog_material = 0x7f04000a; public static final int abc_dialog_title_material = 0x7f04000b; public static final int abc_expanded_menu_layout = 0x7f04000c; public static final int abc_list_menu_item_checkbox = 0x7f04000d; public static final int abc_list_menu_item_icon = 0x7f04000e; public static final int abc_list_menu_item_layout = 0x7f04000f; public static final int abc_list_menu_item_radio = 0x7f040010; public static final int abc_popup_menu_item_layout = 0x7f040012; public static final int abc_screen_content_include = 0x7f040013; public static final int abc_screen_simple = 0x7f040014; public static final int abc_screen_simple_overlay_action_mode = 0x7f040015; public static final int abc_screen_toolbar = 0x7f040016; public static final int abc_search_dropdown_item_icons_2line = 0x7f040017; public static final int abc_search_view = 0x7f040018; public static final int abc_select_dialog_material = 0x7f040019; public static final int notification_media_action = 0x7f040020; public static final int notification_media_cancel_action = 0x7f040021; public static final int notification_template_big_media = 0x7f040022; public static final int notification_template_big_media_narrow = 0x7f040024; public static final int notification_template_media = 0x7f040029; public static final int notification_template_part_chronometer = 0x7f04002b; public static final int notification_template_part_time = 0x7f04002c; public static final int select_dialog_item_material = 0x7f04002d; public static final int select_dialog_multichoice_material = 0x7f04002e; public static final int select_dialog_singlechoice_material = 0x7f04002f; public static final int support_simple_spinner_dropdown_item = 0x7f040030; } public static final class string { public static final int abc_action_bar_home_description = 0x7f080000; public static final int abc_action_bar_home_description_format = 0x7f080001; public static final int abc_action_bar_home_subtitle_description_format = 0x7f080002; public static final int abc_action_bar_up_description = 0x7f080003; public static final int abc_action_menu_overflow_description = 0x7f080004; public static final int abc_action_mode_done = 0x7f080005; public static final int abc_activity_chooser_view_see_all = 0x7f080006; public static final int abc_activitychooserview_choose_application = 0x7f080007; public static final int abc_capital_off = 0x7f080008; public static final int abc_capital_on = 0x7f080009; public static final int abc_search_hint = 0x7f08000a; public static final int abc_searchview_description_clear = 0x7f08000b; public static final int abc_searchview_description_query = 0x7f08000c; public static final int abc_searchview_description_search = 0x7f08000d; public static final int abc_searchview_description_submit = 0x7f08000e; public static final int abc_searchview_description_voice = 0x7f08000f; public static final int abc_shareactionprovider_share_with = 0x7f080010; public static final int abc_shareactionprovider_share_with_application = 0x7f080011; public static final int abc_toolbar_collapse_description = 0x7f080012; public static final int status_bar_notification_info_overflow = 0x7f080025; } public static final class style { public static final int AlertDialog_AppCompat = 0x7f0a00b6; public static final int AlertDialog_AppCompat_Light = 0x7f0a00b7; public static final int Animation_AppCompat_Dialog = 0x7f0a00b8; public static final int Animation_AppCompat_DropDownUp = 0x7f0a00b9; public static final int Base_AlertDialog_AppCompat = 0x7f0a00bb; public static final int Base_AlertDialog_AppCompat_Light = 0x7f0a00bc; public static final int Base_Animation_AppCompat_Dialog = 0x7f0a00bd; public static final int Base_Animation_AppCompat_DropDownUp = 0x7f0a00be; public static final int Base_DialogWindowTitleBackground_AppCompat = 0x7f0a00c1; public static final int Base_DialogWindowTitle_AppCompat = 0x7f0a00c0; public static final int Base_TextAppearance_AppCompat = 0x7f0a004d; public static final int Base_TextAppearance_AppCompat_Body1 = 0x7f0a004e; public static final int Base_TextAppearance_AppCompat_Body2 = 0x7f0a004f; public static final int Base_TextAppearance_AppCompat_Button = 0x7f0a0024; public static final int Base_TextAppearance_AppCompat_Caption = 0x7f0a0050; public static final int Base_TextAppearance_AppCompat_Display1 = 0x7f0a0051; public static final int Base_TextAppearance_AppCompat_Display2 = 0x7f0a0052; public static final int Base_TextAppearance_AppCompat_Display3 = 0x7f0a0053; public static final int Base_TextAppearance_AppCompat_Display4 = 0x7f0a0054; public static final int Base_TextAppearance_AppCompat_Headline = 0x7f0a0055; public static final int Base_TextAppearance_AppCompat_Inverse = 0x7f0a000c; public static final int Base_TextAppearance_AppCompat_Large = 0x7f0a0056; public static final int Base_TextAppearance_AppCompat_Large_Inverse = 0x7f0a000d; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0a0057; public static final int Base_TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0a0058; public static final int Base_TextAppearance_AppCompat_Medium = 0x7f0a0059; public static final int Base_TextAppearance_AppCompat_Medium_Inverse = 0x7f0a000e; public static final int Base_TextAppearance_AppCompat_Menu = 0x7f0a005a; public static final int Base_TextAppearance_AppCompat_SearchResult = 0x7f0a00c2; public static final int Base_TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0a005b; public static final int Base_TextAppearance_AppCompat_SearchResult_Title = 0x7f0a005c; public static final int Base_TextAppearance_AppCompat_Small = 0x7f0a005d; public static final int Base_TextAppearance_AppCompat_Small_Inverse = 0x7f0a000f; public static final int Base_TextAppearance_AppCompat_Subhead = 0x7f0a005e; public static final int Base_TextAppearance_AppCompat_Subhead_Inverse = 0x7f0a0010; public static final int Base_TextAppearance_AppCompat_Title = 0x7f0a005f; public static final int Base_TextAppearance_AppCompat_Title_Inverse = 0x7f0a0011; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0a00ac; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0a0060; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0a0061; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0a0062; public static final int Base_TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0a0063; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0a0064; public static final int Base_TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0a0065; public static final int Base_TextAppearance_AppCompat_Widget_Button = 0x7f0a0066; public static final int Base_TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0a00ad; public static final int Base_TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0a00c3; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0a0068; public static final int Base_TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0a0069; public static final int Base_TextAppearance_AppCompat_Widget_Switch = 0x7f0a006a; public static final int Base_TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0a006b; public static final int Base_TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0a00c4; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0a006c; public static final int Base_TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0a006d; public static final int Base_ThemeOverlay_AppCompat = 0x7f0a00cd; public static final int Base_ThemeOverlay_AppCompat_ActionBar = 0x7f0a00ce; public static final int Base_ThemeOverlay_AppCompat_Dark = 0x7f0a00cf; public static final int Base_ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0a00d0; public static final int Base_ThemeOverlay_AppCompat_Light = 0x7f0a00d2; public static final int Base_Theme_AppCompat = 0x7f0a006e; public static final int Base_Theme_AppCompat_CompactMenu = 0x7f0a00c5; public static final int Base_Theme_AppCompat_Dialog = 0x7f0a0012; public static final int Base_Theme_AppCompat_DialogWhenLarge = 0x7f0a0001; public static final int Base_Theme_AppCompat_Dialog_Alert = 0x7f0a00c6; public static final int Base_Theme_AppCompat_Dialog_FixedSize = 0x7f0a00c7; public static final int Base_Theme_AppCompat_Dialog_MinWidth = 0x7f0a00c8; public static final int Base_Theme_AppCompat_Light = 0x7f0a006f; public static final int Base_Theme_AppCompat_Light_DarkActionBar = 0x7f0a00c9; public static final int Base_Theme_AppCompat_Light_Dialog = 0x7f0a0013; public static final int Base_Theme_AppCompat_Light_DialogWhenLarge = 0x7f0a0002; public static final int Base_Theme_AppCompat_Light_Dialog_Alert = 0x7f0a00ca; public static final int Base_Theme_AppCompat_Light_Dialog_FixedSize = 0x7f0a00cb; public static final int Base_Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0a00cc; public static final int Base_V11_Theme_AppCompat_Dialog = 0x7f0a0015; public static final int Base_V11_Theme_AppCompat_Light_Dialog = 0x7f0a0016; public static final int Base_V12_Widget_AppCompat_AutoCompleteTextView = 0x7f0a0020; public static final int Base_V12_Widget_AppCompat_EditText = 0x7f0a0021; public static final int Base_V21_Theme_AppCompat = 0x7f0a0070; public static final int Base_V21_Theme_AppCompat_Dialog = 0x7f0a0071; public static final int Base_V21_Theme_AppCompat_Light = 0x7f0a0072; public static final int Base_V21_Theme_AppCompat_Light_Dialog = 0x7f0a0073; public static final int Base_V22_Theme_AppCompat = 0x7f0a00aa; public static final int Base_V22_Theme_AppCompat_Light = 0x7f0a00ab; public static final int Base_V23_Theme_AppCompat = 0x7f0a00ae; public static final int Base_V23_Theme_AppCompat_Light = 0x7f0a00af; public static final int Base_V7_Theme_AppCompat = 0x7f0a00d3; public static final int Base_V7_Theme_AppCompat_Dialog = 0x7f0a00d4; public static final int Base_V7_Theme_AppCompat_Light = 0x7f0a00d5; public static final int Base_V7_Theme_AppCompat_Light_Dialog = 0x7f0a00d6; public static final int Base_V7_Widget_AppCompat_AutoCompleteTextView = 0x7f0a00d8; public static final int Base_V7_Widget_AppCompat_EditText = 0x7f0a00d9; public static final int Base_Widget_AppCompat_ActionBar = 0x7f0a00da; public static final int Base_Widget_AppCompat_ActionBar_Solid = 0x7f0a00db; public static final int Base_Widget_AppCompat_ActionBar_TabBar = 0x7f0a00dc; public static final int Base_Widget_AppCompat_ActionBar_TabText = 0x7f0a0075; public static final int Base_Widget_AppCompat_ActionBar_TabView = 0x7f0a0076; public static final int Base_Widget_AppCompat_ActionButton = 0x7f0a0077; public static final int Base_Widget_AppCompat_ActionButton_CloseMode = 0x7f0a0078; public static final int Base_Widget_AppCompat_ActionButton_Overflow = 0x7f0a0079; public static final int Base_Widget_AppCompat_ActionMode = 0x7f0a00dd; public static final int Base_Widget_AppCompat_ActivityChooserView = 0x7f0a00de; public static final int Base_Widget_AppCompat_AutoCompleteTextView = 0x7f0a0022; public static final int Base_Widget_AppCompat_Button = 0x7f0a007a; public static final int Base_Widget_AppCompat_ButtonBar = 0x7f0a007e; public static final int Base_Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0a00e0; public static final int Base_Widget_AppCompat_Button_Borderless = 0x7f0a007b; public static final int Base_Widget_AppCompat_Button_Borderless_Colored = 0x7f0a007c; public static final int Base_Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0a00df; public static final int Base_Widget_AppCompat_Button_Colored = 0x7f0a00b0; public static final int Base_Widget_AppCompat_Button_Small = 0x7f0a007d; public static final int Base_Widget_AppCompat_CompoundButton_CheckBox = 0x7f0a007f; public static final int Base_Widget_AppCompat_CompoundButton_RadioButton = 0x7f0a0080; public static final int Base_Widget_AppCompat_CompoundButton_Switch = 0x7f0a00e1; public static final int Base_Widget_AppCompat_DrawerArrowToggle = 0x7f0a0000; public static final int Base_Widget_AppCompat_DrawerArrowToggle_Common = 0x7f0a00e2; public static final int Base_Widget_AppCompat_DropDownItem_Spinner = 0x7f0a0081; public static final int Base_Widget_AppCompat_EditText = 0x7f0a0023; public static final int Base_Widget_AppCompat_ImageButton = 0x7f0a0082; public static final int Base_Widget_AppCompat_Light_ActionBar = 0x7f0a00e3; public static final int Base_Widget_AppCompat_Light_ActionBar_Solid = 0x7f0a00e4; public static final int Base_Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0a00e5; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText = 0x7f0a0083; public static final int Base_Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0a0084; public static final int Base_Widget_AppCompat_Light_ActionBar_TabView = 0x7f0a0085; public static final int Base_Widget_AppCompat_Light_PopupMenu = 0x7f0a0086; public static final int Base_Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0a0087; public static final int Base_Widget_AppCompat_ListPopupWindow = 0x7f0a0088; public static final int Base_Widget_AppCompat_ListView = 0x7f0a0089; public static final int Base_Widget_AppCompat_ListView_DropDown = 0x7f0a008a; public static final int Base_Widget_AppCompat_ListView_Menu = 0x7f0a008b; public static final int Base_Widget_AppCompat_PopupMenu = 0x7f0a008c; public static final int Base_Widget_AppCompat_PopupMenu_Overflow = 0x7f0a008d; public static final int Base_Widget_AppCompat_PopupWindow = 0x7f0a00e7; public static final int Base_Widget_AppCompat_ProgressBar = 0x7f0a0018; public static final int Base_Widget_AppCompat_ProgressBar_Horizontal = 0x7f0a0019; public static final int Base_Widget_AppCompat_RatingBar = 0x7f0a008e; public static final int Base_Widget_AppCompat_RatingBar_Indicator = 0x7f0a00b1; public static final int Base_Widget_AppCompat_RatingBar_Small = 0x7f0a00b2; public static final int Base_Widget_AppCompat_SearchView = 0x7f0a00e8; public static final int Base_Widget_AppCompat_SearchView_ActionBar = 0x7f0a00e9; public static final int Base_Widget_AppCompat_SeekBar = 0x7f0a008f; public static final int Base_Widget_AppCompat_Spinner = 0x7f0a0090; public static final int Base_Widget_AppCompat_Spinner_Underlined = 0x7f0a0003; public static final int Base_Widget_AppCompat_TextView_SpinnerItem = 0x7f0a0091; public static final int Base_Widget_AppCompat_Toolbar = 0x7f0a00eb; public static final int Base_Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0a0092; public static final int Platform_AppCompat = 0x7f0a001a; public static final int Platform_AppCompat_Light = 0x7f0a001b; public static final int Platform_ThemeOverlay_AppCompat = 0x7f0a0093; public static final int Platform_ThemeOverlay_AppCompat_Dark = 0x7f0a0094; public static final int Platform_ThemeOverlay_AppCompat_Light = 0x7f0a0095; public static final int Platform_V11_AppCompat = 0x7f0a001c; public static final int Platform_V11_AppCompat_Light = 0x7f0a001d; public static final int Platform_V14_AppCompat = 0x7f0a0025; public static final int Platform_V14_AppCompat_Light = 0x7f0a0026; public static final int Platform_Widget_AppCompat_Spinner = 0x7f0a001e; public static final int RtlOverlay_DialogWindowTitle_AppCompat = 0x7f0a002e; public static final int RtlOverlay_Widget_AppCompat_ActionBar_TitleItem = 0x7f0a002f; public static final int RtlOverlay_Widget_AppCompat_DialogTitle_Icon = 0x7f0a0030; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem = 0x7f0a0031; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_InternalGroup = 0x7f0a0032; public static final int RtlOverlay_Widget_AppCompat_PopupMenuItem_Text = 0x7f0a0033; public static final int RtlOverlay_Widget_AppCompat_SearchView_MagIcon = 0x7f0a0039; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown = 0x7f0a0034; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon1 = 0x7f0a0035; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Icon2 = 0x7f0a0036; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Query = 0x7f0a0037; public static final int RtlOverlay_Widget_AppCompat_Search_DropDown_Text = 0x7f0a0038; public static final int RtlUnderlay_Widget_AppCompat_ActionButton = 0x7f0a003a; public static final int RtlUnderlay_Widget_AppCompat_ActionButton_Overflow = 0x7f0a003b; public static final int TextAppearance_AppCompat = 0x7f0a00ee; public static final int TextAppearance_AppCompat_Body1 = 0x7f0a00ef; public static final int TextAppearance_AppCompat_Body2 = 0x7f0a00f0; public static final int TextAppearance_AppCompat_Button = 0x7f0a00f1; public static final int TextAppearance_AppCompat_Caption = 0x7f0a00f2; public static final int TextAppearance_AppCompat_Display1 = 0x7f0a00f3; public static final int TextAppearance_AppCompat_Display2 = 0x7f0a00f4; public static final int TextAppearance_AppCompat_Display3 = 0x7f0a00f5; public static final int TextAppearance_AppCompat_Display4 = 0x7f0a00f6; public static final int TextAppearance_AppCompat_Headline = 0x7f0a00f7; public static final int TextAppearance_AppCompat_Inverse = 0x7f0a00f8; public static final int TextAppearance_AppCompat_Large = 0x7f0a00f9; public static final int TextAppearance_AppCompat_Large_Inverse = 0x7f0a00fa; public static final int TextAppearance_AppCompat_Light_SearchResult_Subtitle = 0x7f0a00fb; public static final int TextAppearance_AppCompat_Light_SearchResult_Title = 0x7f0a00fc; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Large = 0x7f0a00fd; public static final int TextAppearance_AppCompat_Light_Widget_PopupMenu_Small = 0x7f0a00fe; public static final int TextAppearance_AppCompat_Medium = 0x7f0a00ff; public static final int TextAppearance_AppCompat_Medium_Inverse = 0x7f0a0100; public static final int TextAppearance_AppCompat_Menu = 0x7f0a0101; public static final int TextAppearance_AppCompat_SearchResult_Subtitle = 0x7f0a0104; public static final int TextAppearance_AppCompat_SearchResult_Title = 0x7f0a0105; public static final int TextAppearance_AppCompat_Small = 0x7f0a0106; public static final int TextAppearance_AppCompat_Small_Inverse = 0x7f0a0107; public static final int TextAppearance_AppCompat_Subhead = 0x7f0a0108; public static final int TextAppearance_AppCompat_Subhead_Inverse = 0x7f0a0109; public static final int TextAppearance_AppCompat_Title = 0x7f0a010a; public static final int TextAppearance_AppCompat_Title_Inverse = 0x7f0a010b; public static final int TextAppearance_AppCompat_Widget_ActionBar_Menu = 0x7f0a010c; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle = 0x7f0a010d; public static final int TextAppearance_AppCompat_Widget_ActionBar_Subtitle_Inverse = 0x7f0a010e; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title = 0x7f0a010f; public static final int TextAppearance_AppCompat_Widget_ActionBar_Title_Inverse = 0x7f0a0110; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle = 0x7f0a0111; public static final int TextAppearance_AppCompat_Widget_ActionMode_Subtitle_Inverse = 0x7f0a0112; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title = 0x7f0a0113; public static final int TextAppearance_AppCompat_Widget_ActionMode_Title_Inverse = 0x7f0a0114; public static final int TextAppearance_AppCompat_Widget_Button = 0x7f0a0115; public static final int TextAppearance_AppCompat_Widget_Button_Inverse = 0x7f0a0116; public static final int TextAppearance_AppCompat_Widget_DropDownItem = 0x7f0a0117; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Large = 0x7f0a0119; public static final int TextAppearance_AppCompat_Widget_PopupMenu_Small = 0x7f0a011a; public static final int TextAppearance_AppCompat_Widget_Switch = 0x7f0a011b; public static final int TextAppearance_AppCompat_Widget_TextView_SpinnerItem = 0x7f0a011c; public static final int TextAppearance_StatusBar_EventContent = 0x7f0a0029; public static final int TextAppearance_StatusBar_EventContent_Info = 0x7f0a002a; public static final int TextAppearance_StatusBar_EventContent_Line2 = 0x7f0a002b; public static final int TextAppearance_StatusBar_EventContent_Time = 0x7f0a002c; public static final int TextAppearance_StatusBar_EventContent_Title = 0x7f0a002d; public static final int TextAppearance_Widget_AppCompat_ExpandedMenu_Item = 0x7f0a011d; public static final int TextAppearance_Widget_AppCompat_Toolbar_Subtitle = 0x7f0a011e; public static final int TextAppearance_Widget_AppCompat_Toolbar_Title = 0x7f0a011f; public static final int ThemeOverlay_AppCompat = 0x7f0a012f; public static final int ThemeOverlay_AppCompat_ActionBar = 0x7f0a0130; public static final int ThemeOverlay_AppCompat_Dark = 0x7f0a0131; public static final int ThemeOverlay_AppCompat_Dark_ActionBar = 0x7f0a0132; public static final int ThemeOverlay_AppCompat_Light = 0x7f0a0135; public static final int Theme_AppCompat = 0x7f0a0120; public static final int Theme_AppCompat_CompactMenu = 0x7f0a0121; public static final int Theme_AppCompat_DayNight = 0x7f0a0004; public static final int Theme_AppCompat_DayNight_DarkActionBar = 0x7f0a0005; public static final int Theme_AppCompat_DayNight_Dialog = 0x7f0a0006; public static final int Theme_AppCompat_DayNight_DialogWhenLarge = 0x7f0a0009; public static final int Theme_AppCompat_DayNight_Dialog_Alert = 0x7f0a0007; public static final int Theme_AppCompat_DayNight_Dialog_MinWidth = 0x7f0a0008; public static final int Theme_AppCompat_DayNight_NoActionBar = 0x7f0a000a; public static final int Theme_AppCompat_Dialog = 0x7f0a0122; public static final int Theme_AppCompat_DialogWhenLarge = 0x7f0a0125; public static final int Theme_AppCompat_Dialog_Alert = 0x7f0a0123; public static final int Theme_AppCompat_Dialog_MinWidth = 0x7f0a0124; public static final int Theme_AppCompat_Light = 0x7f0a0126; public static final int Theme_AppCompat_Light_DarkActionBar = 0x7f0a0127; public static final int Theme_AppCompat_Light_Dialog = 0x7f0a0128; public static final int Theme_AppCompat_Light_DialogWhenLarge = 0x7f0a012b; public static final int Theme_AppCompat_Light_Dialog_Alert = 0x7f0a0129; public static final int Theme_AppCompat_Light_Dialog_MinWidth = 0x7f0a012a; public static final int Theme_AppCompat_Light_NoActionBar = 0x7f0a012c; public static final int Theme_AppCompat_NoActionBar = 0x7f0a012d; public static final int Widget_AppCompat_ActionBar = 0x7f0a0137; public static final int Widget_AppCompat_ActionBar_Solid = 0x7f0a0138; public static final int Widget_AppCompat_ActionBar_TabBar = 0x7f0a0139; public static final int Widget_AppCompat_ActionBar_TabText = 0x7f0a013a; public static final int Widget_AppCompat_ActionBar_TabView = 0x7f0a013b; public static final int Widget_AppCompat_ActionButton = 0x7f0a013c; public static final int Widget_AppCompat_ActionButton_CloseMode = 0x7f0a013d; public static final int Widget_AppCompat_ActionButton_Overflow = 0x7f0a013e; public static final int Widget_AppCompat_ActionMode = 0x7f0a013f; public static final int Widget_AppCompat_ActivityChooserView = 0x7f0a0140; public static final int Widget_AppCompat_AutoCompleteTextView = 0x7f0a0141; public static final int Widget_AppCompat_Button = 0x7f0a0142; public static final int Widget_AppCompat_ButtonBar = 0x7f0a0148; public static final int Widget_AppCompat_ButtonBar_AlertDialog = 0x7f0a0149; public static final int Widget_AppCompat_Button_Borderless = 0x7f0a0143; public static final int Widget_AppCompat_Button_Borderless_Colored = 0x7f0a0144; public static final int Widget_AppCompat_Button_ButtonBar_AlertDialog = 0x7f0a0145; public static final int Widget_AppCompat_Button_Colored = 0x7f0a0146; public static final int Widget_AppCompat_Button_Small = 0x7f0a0147; public static final int Widget_AppCompat_CompoundButton_CheckBox = 0x7f0a014a; public static final int Widget_AppCompat_CompoundButton_RadioButton = 0x7f0a014b; public static final int Widget_AppCompat_CompoundButton_Switch = 0x7f0a014c; public static final int Widget_AppCompat_DrawerArrowToggle = 0x7f0a014d; public static final int Widget_AppCompat_DropDownItem_Spinner = 0x7f0a014e; public static final int Widget_AppCompat_EditText = 0x7f0a014f; public static final int Widget_AppCompat_ImageButton = 0x7f0a0150; public static final int Widget_AppCompat_Light_ActionBar = 0x7f0a0151; public static final int Widget_AppCompat_Light_ActionBar_Solid = 0x7f0a0152; public static final int Widget_AppCompat_Light_ActionBar_Solid_Inverse = 0x7f0a0153; public static final int Widget_AppCompat_Light_ActionBar_TabBar = 0x7f0a0154; public static final int Widget_AppCompat_Light_ActionBar_TabBar_Inverse = 0x7f0a0155; public static final int Widget_AppCompat_Light_ActionBar_TabText = 0x7f0a0156; public static final int Widget_AppCompat_Light_ActionBar_TabText_Inverse = 0x7f0a0157; public static final int Widget_AppCompat_Light_ActionBar_TabView = 0x7f0a0158; public static final int Widget_AppCompat_Light_ActionBar_TabView_Inverse = 0x7f0a0159; public static final int Widget_AppCompat_Light_ActionButton = 0x7f0a015a; public static final int Widget_AppCompat_Light_ActionButton_CloseMode = 0x7f0a015b; public static final int Widget_AppCompat_Light_ActionButton_Overflow = 0x7f0a015c; public static final int Widget_AppCompat_Light_ActionMode_Inverse = 0x7f0a015d; public static final int Widget_AppCompat_Light_ActivityChooserView = 0x7f0a015e; public static final int Widget_AppCompat_Light_AutoCompleteTextView = 0x7f0a015f; public static final int Widget_AppCompat_Light_DropDownItem_Spinner = 0x7f0a0160; public static final int Widget_AppCompat_Light_ListPopupWindow = 0x7f0a0161; public static final int Widget_AppCompat_Light_ListView_DropDown = 0x7f0a0162; public static final int Widget_AppCompat_Light_PopupMenu = 0x7f0a0163; public static final int Widget_AppCompat_Light_PopupMenu_Overflow = 0x7f0a0164; public static final int Widget_AppCompat_Light_SearchView = 0x7f0a0165; public static final int Widget_AppCompat_Light_Spinner_DropDown_ActionBar = 0x7f0a0166; public static final int Widget_AppCompat_ListPopupWindow = 0x7f0a0168; public static final int Widget_AppCompat_ListView = 0x7f0a0169; public static final int Widget_AppCompat_ListView_DropDown = 0x7f0a016a; public static final int Widget_AppCompat_ListView_Menu = 0x7f0a016b; public static final int Widget_AppCompat_PopupMenu = 0x7f0a016c; public static final int Widget_AppCompat_PopupMenu_Overflow = 0x7f0a016d; public static final int Widget_AppCompat_PopupWindow = 0x7f0a016e; public static final int Widget_AppCompat_ProgressBar = 0x7f0a016f; public static final int Widget_AppCompat_ProgressBar_Horizontal = 0x7f0a0170; public static final int Widget_AppCompat_RatingBar = 0x7f0a0171; public static final int Widget_AppCompat_RatingBar_Indicator = 0x7f0a0172; public static final int Widget_AppCompat_RatingBar_Small = 0x7f0a0173; public static final int Widget_AppCompat_SearchView = 0x7f0a0174; public static final int Widget_AppCompat_SearchView_ActionBar = 0x7f0a0175; public static final int Widget_AppCompat_SeekBar = 0x7f0a0176; public static final int Widget_AppCompat_Spinner = 0x7f0a0178; public static final int Widget_AppCompat_Spinner_DropDown = 0x7f0a0179; public static final int Widget_AppCompat_Spinner_DropDown_ActionBar = 0x7f0a017a; public static final int Widget_AppCompat_Spinner_Underlined = 0x7f0a017b; public static final int Widget_AppCompat_TextView_SpinnerItem = 0x7f0a017c; public static final int Widget_AppCompat_Toolbar = 0x7f0a017d; public static final int Widget_AppCompat_Toolbar_Button_Navigation = 0x7f0a017e; } public static final class styleable { public static final int[] ActionBar = { 0x7f010001, 0x7f010003, 0x7f010004, 0x7f010005, 0x7f010006, 0x7f010007, 0x7f010008, 0x7f010009, 0x7f01000a, 0x7f01000b, 0x7f01000c, 0x7f01000d, 0x7f01000e, 0x7f01000f, 0x7f010010, 0x7f010011, 0x7f010012, 0x7f010013, 0x7f010014, 0x7f010015, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001c, 0x7f01001d, 0x7f01005c }; public static final int[] ActionBarLayout = { 0x010100b3 }; public static final int ActionBarLayout_android_layout_gravity = 0; public static final int ActionBar_background = 10; public static final int ActionBar_backgroundSplit = 12; public static final int ActionBar_backgroundStacked = 11; public static final int ActionBar_contentInsetEnd = 21; public static final int ActionBar_contentInsetLeft = 22; public static final int ActionBar_contentInsetRight = 23; public static final int ActionBar_contentInsetStart = 20; public static final int ActionBar_customNavigationLayout = 13; public static final int ActionBar_displayOptions = 3; public static final int ActionBar_divider = 9; public static final int ActionBar_elevation = 26; public static final int ActionBar_height = 0; public static final int ActionBar_hideOnContentScroll = 19; public static final int ActionBar_homeAsUpIndicator = 28; public static final int ActionBar_homeLayout = 14; public static final int ActionBar_icon = 7; public static final int ActionBar_indeterminateProgressStyle = 16; public static final int ActionBar_itemPadding = 18; public static final int ActionBar_logo = 8; public static final int ActionBar_navigationMode = 2; public static final int ActionBar_popupTheme = 27; public static final int ActionBar_progressBarPadding = 17; public static final int ActionBar_progressBarStyle = 15; public static final int ActionBar_subtitle = 4; public static final int ActionBar_subtitleTextStyle = 6; public static final int ActionBar_title = 1; public static final int ActionBar_titleTextStyle = 5; public static final int[] ActionMenuItemView = { 0x0101013f }; public static final int ActionMenuItemView_android_minWidth = 0; public static final int[] ActionMenuView = { }; public static final int[] ActionMode = { 0x7f010001, 0x7f010007, 0x7f010008, 0x7f01000c, 0x7f01000e, 0x7f010020 }; public static final int ActionMode_background = 3; public static final int ActionMode_backgroundSplit = 4; public static final int ActionMode_closeItemLayout = 5; public static final int ActionMode_height = 0; public static final int ActionMode_subtitleTextStyle = 2; public static final int ActionMode_titleTextStyle = 1; public static final int[] ActivityChooserView = { 0x7f010021, 0x7f010022 }; public static final int ActivityChooserView_expandActivityOverflowButtonDrawable = 1; public static final int ActivityChooserView_initialActivityCount = 0; public static final int[] AlertDialog = { 0x010100f2, 0x7f010023, 0x7f010024, 0x7f010025, 0x7f010026, 0x7f010027 }; public static final int AlertDialog_android_layout = 0; public static final int AlertDialog_buttonPanelSideLayout = 1; public static final int AlertDialog_listItemLayout = 5; public static final int AlertDialog_listLayout = 2; public static final int AlertDialog_multiChoiceItemLayout = 3; public static final int AlertDialog_singleChoiceItemLayout = 4; public static final int[] AppCompatImageView = { 0x01010119, 0x7f010028 }; public static final int AppCompatImageView_android_src = 0; public static final int AppCompatImageView_srcCompat = 1; public static final int[] AppCompatTextView = { 0x01010034, 0x7f01002c }; public static final int AppCompatTextView_android_textAppearance = 0; public static final int AppCompatTextView_textAllCaps = 1; public static final int[] AppCompatTheme = { 0x01010057, 0x010100ae, 0x7f01002d, 0x7f01002e, 0x7f01002f, 0x7f010030, 0x7f010031, 0x7f010032, 0x7f010033, 0x7f010034, 0x7f010035, 0x7f010036, 0x7f010037, 0x7f010038, 0x7f010039, 0x7f01003a, 0x7f01003b, 0x7f01003c, 0x7f01003d, 0x7f01003e, 0x7f01003f, 0x7f010040, 0x7f010041, 0x7f010042, 0x7f010043, 0x7f010044, 0x7f010045, 0x7f010046, 0x7f010047, 0x7f010048, 0x7f010049, 0x7f01004a, 0x7f01004b, 0x7f01004c, 0x7f01004d, 0x7f01004e, 0x7f01004f, 0x7f010050, 0x7f010051, 0x7f010052, 0x7f010053, 0x7f010054, 0x7f010055, 0x7f010056, 0x7f010057, 0x7f010058, 0x7f010059, 0x7f01005a, 0x7f01005b, 0x7f01005c, 0x7f01005d, 0x7f01005e, 0x7f01005f, 0x7f010060, 0x7f010061, 0x7f010062, 0x7f010063, 0x7f010064, 0x7f010065, 0x7f010066, 0x7f010067, 0x7f010068, 0x7f010069, 0x7f01006a, 0x7f01006b, 0x7f01006c, 0x7f01006d, 0x7f01006e, 0x7f01006f, 0x7f010070, 0x7f010071, 0x7f010072, 0x7f010073, 0x7f010074, 0x7f010075, 0x7f010076, 0x7f010077, 0x7f010078, 0x7f010079, 0x7f01007a, 0x7f01007b, 0x7f01007c, 0x7f01007d, 0x7f01007e, 0x7f01007f, 0x7f010080, 0x7f010081, 0x7f010082, 0x7f010083, 0x7f010084, 0x7f010085, 0x7f010086, 0x7f010087, 0x7f010088, 0x7f010089, 0x7f01008a, 0x7f01008b, 0x7f01008c, 0x7f01008d, 0x7f01008e, 0x7f01008f, 0x7f010090, 0x7f010091, 0x7f010092, 0x7f010093, 0x7f010094, 0x7f010095, 0x7f010096, 0x7f010097, 0x7f010098, 0x7f010099, 0x7f01009a, 0x7f01009b, 0x7f01009c, 0x7f01009d }; public static final int AppCompatTheme_actionBarDivider = 23; public static final int AppCompatTheme_actionBarItemBackground = 24; public static final int AppCompatTheme_actionBarPopupTheme = 17; public static final int AppCompatTheme_actionBarSize = 22; public static final int AppCompatTheme_actionBarSplitStyle = 19; public static final int AppCompatTheme_actionBarStyle = 18; public static final int AppCompatTheme_actionBarTabBarStyle = 13; public static final int AppCompatTheme_actionBarTabStyle = 12; public static final int AppCompatTheme_actionBarTabTextStyle = 14; public static final int AppCompatTheme_actionBarTheme = 20; public static final int AppCompatTheme_actionBarWidgetTheme = 21; public static final int AppCompatTheme_actionButtonStyle = 50; public static final int AppCompatTheme_actionDropDownStyle = 46; public static final int AppCompatTheme_actionMenuTextAppearance = 25; public static final int AppCompatTheme_actionMenuTextColor = 26; public static final int AppCompatTheme_actionModeBackground = 29; public static final int AppCompatTheme_actionModeCloseButtonStyle = 28; public static final int AppCompatTheme_actionModeCloseDrawable = 31; public static final int AppCompatTheme_actionModeCopyDrawable = 33; public static final int AppCompatTheme_actionModeCutDrawable = 32; public static final int AppCompatTheme_actionModeFindDrawable = 37; public static final int AppCompatTheme_actionModePasteDrawable = 34; public static final int AppCompatTheme_actionModePopupWindowStyle = 39; public static final int AppCompatTheme_actionModeSelectAllDrawable = 35; public static final int AppCompatTheme_actionModeShareDrawable = 36; public static final int AppCompatTheme_actionModeSplitBackground = 30; public static final int AppCompatTheme_actionModeStyle = 27; public static final int AppCompatTheme_actionModeWebSearchDrawable = 38; public static final int AppCompatTheme_actionOverflowButtonStyle = 15; public static final int AppCompatTheme_actionOverflowMenuStyle = 16; public static final int AppCompatTheme_activityChooserViewStyle = 58; public static final int AppCompatTheme_alertDialogButtonGroupStyle = 94; public static final int AppCompatTheme_alertDialogCenterButtons = 95; public static final int AppCompatTheme_alertDialogStyle = 93; public static final int AppCompatTheme_alertDialogTheme = 96; public static final int AppCompatTheme_android_windowAnimationStyle = 1; public static final int AppCompatTheme_android_windowIsFloating = 0; public static final int AppCompatTheme_autoCompleteTextViewStyle = 101; public static final int AppCompatTheme_borderlessButtonStyle = 55; public static final int AppCompatTheme_buttonBarButtonStyle = 52; public static final int AppCompatTheme_buttonBarNegativeButtonStyle = 99; public static final int AppCompatTheme_buttonBarNeutralButtonStyle = 100; public static final int AppCompatTheme_buttonBarPositiveButtonStyle = 98; public static final int AppCompatTheme_buttonBarStyle = 51; public static final int AppCompatTheme_buttonStyle = 102; public static final int AppCompatTheme_buttonStyleSmall = 103; public static final int AppCompatTheme_checkboxStyle = 104; public static final int AppCompatTheme_checkedTextViewStyle = 105; public static final int AppCompatTheme_colorAccent = 85; public static final int AppCompatTheme_colorButtonNormal = 89; public static final int AppCompatTheme_colorControlActivated = 87; public static final int AppCompatTheme_colorControlHighlight = 88; public static final int AppCompatTheme_colorControlNormal = 86; public static final int AppCompatTheme_colorPrimary = 83; public static final int AppCompatTheme_colorPrimaryDark = 84; public static final int AppCompatTheme_colorSwitchThumbNormal = 90; public static final int AppCompatTheme_controlBackground = 91; public static final int AppCompatTheme_dialogPreferredPadding = 44; public static final int AppCompatTheme_dialogTheme = 43; public static final int AppCompatTheme_dividerHorizontal = 57; public static final int AppCompatTheme_dividerVertical = 56; public static final int AppCompatTheme_dropDownListViewStyle = 75; public static final int AppCompatTheme_dropdownListPreferredItemHeight = 47; public static final int AppCompatTheme_editTextBackground = 64; public static final int AppCompatTheme_editTextColor = 63; public static final int AppCompatTheme_editTextStyle = 106; public static final int AppCompatTheme_homeAsUpIndicator = 49; public static final int AppCompatTheme_imageButtonStyle = 65; public static final int AppCompatTheme_listChoiceBackgroundIndicator = 82; public static final int AppCompatTheme_listDividerAlertDialog = 45; public static final int AppCompatTheme_listPopupWindowStyle = 76; public static final int AppCompatTheme_listPreferredItemHeight = 70; public static final int AppCompatTheme_listPreferredItemHeightLarge = 72; public static final int AppCompatTheme_listPreferredItemHeightSmall = 71; public static final int AppCompatTheme_listPreferredItemPaddingLeft = 73; public static final int AppCompatTheme_listPreferredItemPaddingRight = 74; public static final int AppCompatTheme_panelBackground = 79; public static final int AppCompatTheme_panelMenuListTheme = 81; public static final int AppCompatTheme_panelMenuListWidth = 80; public static final int AppCompatTheme_popupMenuStyle = 61; public static final int AppCompatTheme_popupWindowStyle = 62; public static final int AppCompatTheme_radioButtonStyle = 107; public static final int AppCompatTheme_ratingBarStyle = 108; public static final int AppCompatTheme_ratingBarStyleIndicator = 109; public static final int AppCompatTheme_ratingBarStyleSmall = 110; public static final int AppCompatTheme_searchViewStyle = 69; public static final int AppCompatTheme_seekBarStyle = 111; public static final int AppCompatTheme_selectableItemBackground = 53; public static final int AppCompatTheme_selectableItemBackgroundBorderless = 54; public static final int AppCompatTheme_spinnerDropDownItemStyle = 48; public static final int AppCompatTheme_spinnerStyle = 112; public static final int AppCompatTheme_switchStyle = 113; public static final int AppCompatTheme_textAppearanceLargePopupMenu = 40; public static final int AppCompatTheme_textAppearanceListItem = 77; public static final int AppCompatTheme_textAppearanceListItemSmall = 78; public static final int AppCompatTheme_textAppearanceSearchResultSubtitle = 67; public static final int AppCompatTheme_textAppearanceSearchResultTitle = 66; public static final int AppCompatTheme_textAppearanceSmallPopupMenu = 41; public static final int AppCompatTheme_textColorAlertDialogListItem = 97; public static final int AppCompatTheme_textColorSearchUrl = 68; public static final int AppCompatTheme_toolbarNavigationButtonStyle = 60; public static final int AppCompatTheme_toolbarStyle = 59; public static final int AppCompatTheme_windowActionBar = 2; public static final int AppCompatTheme_windowActionBarOverlay = 4; public static final int AppCompatTheme_windowActionModeOverlay = 5; public static final int AppCompatTheme_windowFixedHeightMajor = 9; public static final int AppCompatTheme_windowFixedHeightMinor = 7; public static final int AppCompatTheme_windowFixedWidthMajor = 6; public static final int AppCompatTheme_windowFixedWidthMinor = 8; public static final int AppCompatTheme_windowMinWidthMajor = 10; public static final int AppCompatTheme_windowMinWidthMinor = 11; public static final int AppCompatTheme_windowNoTitle = 3; public static final int[] ButtonBarLayout = { 0x7f01009f }; public static final int ButtonBarLayout_allowStacking = 0; public static final int[] CompoundButton = { 0x01010107, 0x7f0100bc, 0x7f0100bd }; public static final int CompoundButton_android_button = 0; public static final int CompoundButton_buttonTint = 1; public static final int CompoundButton_buttonTintMode = 2; public static final int[] DrawerArrowToggle = { 0x7f0100cc, 0x7f0100cd, 0x7f0100ce, 0x7f0100cf, 0x7f0100d0, 0x7f0100d1, 0x7f0100d2, 0x7f0100d3 }; public static final int DrawerArrowToggle_arrowHeadLength = 4; public static final int DrawerArrowToggle_arrowShaftLength = 5; public static final int DrawerArrowToggle_barLength = 6; public static final int DrawerArrowToggle_color = 0; public static final int DrawerArrowToggle_drawableSize = 2; public static final int DrawerArrowToggle_gapBetweenBars = 3; public static final int DrawerArrowToggle_spinBars = 1; public static final int DrawerArrowToggle_thickness = 7; public static final int[] LinearLayoutCompat = { 0x010100af, 0x010100c4, 0x01010126, 0x01010127, 0x01010128, 0x7f01000b, 0x7f0100d4, 0x7f0100d5, 0x7f0100d6 }; public static final int[] LinearLayoutCompat_Layout = { 0x010100b3, 0x010100f4, 0x010100f5, 0x01010181 }; public static final int LinearLayoutCompat_Layout_android_layout_gravity = 0; public static final int LinearLayoutCompat_Layout_android_layout_height = 2; public static final int LinearLayoutCompat_Layout_android_layout_weight = 3; public static final int LinearLayoutCompat_Layout_android_layout_width = 1; public static final int LinearLayoutCompat_android_baselineAligned = 2; public static final int LinearLayoutCompat_android_baselineAlignedChildIndex = 3; public static final int LinearLayoutCompat_android_gravity = 0; public static final int LinearLayoutCompat_android_orientation = 1; public static final int LinearLayoutCompat_android_weightSum = 4; public static final int LinearLayoutCompat_divider = 5; public static final int LinearLayoutCompat_dividerPadding = 8; public static final int LinearLayoutCompat_measureWithLargestChild = 6; public static final int LinearLayoutCompat_showDividers = 7; public static final int[] ListPopupWindow = { 0x010102ac, 0x010102ad }; public static final int ListPopupWindow_android_dropDownHorizontalOffset = 0; public static final int ListPopupWindow_android_dropDownVerticalOffset = 1; public static final int[] MenuGroup = { 0x0101000e, 0x010100d0, 0x01010194, 0x010101de, 0x010101df, 0x010101e0 }; public static final int MenuGroup_android_checkableBehavior = 5; public static final int MenuGroup_android_enabled = 0; public static final int MenuGroup_android_id = 1; public static final int MenuGroup_android_menuCategory = 3; public static final int MenuGroup_android_orderInCategory = 4; public static final int MenuGroup_android_visible = 2; public static final int[] MenuItem = { 0x01010002, 0x0101000e, 0x010100d0, 0x01010106, 0x01010194, 0x010101de, 0x010101df, 0x010101e1, 0x010101e2, 0x010101e3, 0x010101e4, 0x010101e5, 0x0101026f, 0x7f0100da, 0x7f0100db, 0x7f0100dc, 0x7f0100dd }; public static final int MenuItem_actionLayout = 14; public static final int MenuItem_actionProviderClass = 16; public static final int MenuItem_actionViewClass = 15; public static final int MenuItem_android_alphabeticShortcut = 9; public static final int MenuItem_android_checkable = 11; public static final int MenuItem_android_checked = 3; public static final int MenuItem_android_enabled = 1; public static final int MenuItem_android_icon = 0; public static final int MenuItem_android_id = 2; public static final int MenuItem_android_menuCategory = 5; public static final int MenuItem_android_numericShortcut = 10; public static final int MenuItem_android_onClick = 12; public static final int MenuItem_android_orderInCategory = 6; public static final int MenuItem_android_title = 7; public static final int MenuItem_android_titleCondensed = 8; public static final int MenuItem_android_visible = 4; public static final int MenuItem_showAsAction = 13; public static final int[] MenuView = { 0x010100ae, 0x0101012c, 0x0101012d, 0x0101012e, 0x0101012f, 0x01010130, 0x01010131, 0x7f0100de, 0x7f0100df }; public static final int MenuView_android_headerBackground = 4; public static final int MenuView_android_horizontalDivider = 2; public static final int MenuView_android_itemBackground = 5; public static final int MenuView_android_itemIconDisabledAlpha = 6; public static final int MenuView_android_itemTextAppearance = 1; public static final int MenuView_android_verticalDivider = 3; public static final int MenuView_android_windowAnimationStyle = 0; public static final int MenuView_preserveIconSpacing = 7; public static final int[] PopupWindow = { 0x01010176, 0x010102c9, 0x7f0100e0 }; public static final int[] PopupWindowBackgroundState = { 0x7f0100e1 }; public static final int PopupWindowBackgroundState_state_above_anchor = 0; public static final int PopupWindow_android_popupBackground = 0; public static final int PopupWindow_overlapAnchor = 2; public static final int[] SearchView = { 0x010100da, 0x0101011f, 0x01010220, 0x01010264, 0x7f0100e7, 0x7f0100e8, 0x7f0100e9, 0x7f0100ea, 0x7f0100eb, 0x7f0100ec, 0x7f0100ed, 0x7f0100ee, 0x7f0100ef, 0x7f0100f0, 0x7f0100f1, 0x7f0100f2, 0x7f0100f3 }; public static final int SearchView_android_focusable = 0; public static final int SearchView_android_imeOptions = 3; public static final int SearchView_android_inputType = 2; public static final int SearchView_android_maxWidth = 1; public static final int SearchView_closeIcon = 8; public static final int SearchView_commitIcon = 13; public static final int SearchView_defaultQueryHint = 7; public static final int SearchView_goIcon = 9; public static final int SearchView_iconifiedByDefault = 5; public static final int SearchView_layout = 4; public static final int SearchView_queryBackground = 15; public static final int SearchView_queryHint = 6; public static final int SearchView_searchHintIcon = 11; public static final int SearchView_searchIcon = 10; public static final int SearchView_submitBackground = 16; public static final int SearchView_suggestionRowLayout = 14; public static final int SearchView_voiceIcon = 12; public static final int[] Spinner = { 0x010100b2, 0x01010176, 0x0101017b, 0x01010262, 0x7f01001d }; public static final int Spinner_android_dropDownWidth = 3; public static final int Spinner_android_entries = 0; public static final int Spinner_android_popupBackground = 1; public static final int Spinner_android_prompt = 2; public static final int Spinner_popupTheme = 4; public static final int[] SwitchCompat = { 0x01010124, 0x01010125, 0x01010142, 0x7f0100f7, 0x7f0100f8, 0x7f0100f9, 0x7f0100fa, 0x7f0100fb, 0x7f0100fc, 0x7f0100fd, 0x7f0100fe, 0x7f0100ff, 0x7f010100, 0x7f010101 }; public static final int SwitchCompat_android_textOff = 1; public static final int SwitchCompat_android_textOn = 0; public static final int SwitchCompat_android_thumb = 2; public static final int SwitchCompat_showText = 13; public static final int SwitchCompat_splitTrack = 12; public static final int SwitchCompat_switchMinWidth = 10; public static final int SwitchCompat_switchPadding = 11; public static final int SwitchCompat_switchTextAppearance = 9; public static final int SwitchCompat_thumbTextPadding = 8; public static final int SwitchCompat_track = 5; public static final int[] TextAppearance = { 0x01010095, 0x01010096, 0x01010097, 0x01010098, 0x0101009a, 0x01010161, 0x01010162, 0x01010163, 0x01010164, 0x7f01002c }; public static final int TextAppearance_android_shadowColor = 5; public static final int TextAppearance_android_shadowDx = 6; public static final int TextAppearance_android_shadowDy = 7; public static final int TextAppearance_android_shadowRadius = 8; public static final int TextAppearance_android_textColor = 3; public static final int TextAppearance_android_textSize = 0; public static final int TextAppearance_android_textStyle = 2; public static final int TextAppearance_android_typeface = 1; public static final int TextAppearance_textAllCaps = 9; public static final int[] Toolbar = { 0x010100af, 0x01010140, 0x7f010003, 0x7f010006, 0x7f01000a, 0x7f010016, 0x7f010017, 0x7f010018, 0x7f010019, 0x7f01001a, 0x7f01001b, 0x7f01001d, 0x7f010102, 0x7f010103, 0x7f010104, 0x7f010105, 0x7f010106, 0x7f010107, 0x7f010108, 0x7f010109, 0x7f01010a, 0x7f01010b, 0x7f01010c, 0x7f01010d, 0x7f01010e, 0x7f01010f, 0x7f010110, 0x7f010111, 0x7f010112 }; public static final int Toolbar_android_gravity = 0; public static final int Toolbar_android_minHeight = 1; public static final int Toolbar_collapseContentDescription = 23; public static final int Toolbar_collapseIcon = 22; public static final int Toolbar_contentInsetEnd = 6; public static final int Toolbar_contentInsetLeft = 7; public static final int Toolbar_contentInsetRight = 8; public static final int Toolbar_contentInsetStart = 5; public static final int Toolbar_logo = 4; public static final int Toolbar_logoDescription = 26; public static final int Toolbar_maxButtonHeight = 20; public static final int Toolbar_navigationContentDescription = 25; public static final int Toolbar_navigationIcon = 24; public static final int Toolbar_popupTheme = 11; public static final int Toolbar_subtitle = 3; public static final int Toolbar_subtitleTextAppearance = 13; public static final int Toolbar_subtitleTextColor = 28; public static final int Toolbar_title = 2; public static final int Toolbar_titleMarginBottom = 18; public static final int Toolbar_titleMarginEnd = 16; public static final int Toolbar_titleMarginStart = 15; public static final int Toolbar_titleMarginTop = 17; public static final int Toolbar_titleMargins = 19; public static final int Toolbar_titleTextAppearance = 12; public static final int Toolbar_titleTextColor = 27; public static final int[] View = { 0x01010000, 0x010100da, 0x7f010113, 0x7f010114, 0x7f010115 }; public static final int[] ViewBackgroundHelper = { 0x010100d4, 0x7f010116, 0x7f010117 }; public static final int ViewBackgroundHelper_android_background = 0; public static final int ViewBackgroundHelper_backgroundTint = 1; public static final int ViewBackgroundHelper_backgroundTintMode = 2; public static final int[] ViewStubCompat = { 0x010100d0, 0x010100f2, 0x010100f3 }; public static final int ViewStubCompat_android_id = 0; public static final int ViewStubCompat_android_inflatedId = 2; public static final int ViewStubCompat_android_layout = 1; public static final int View_android_focusable = 1; public static final int View_android_theme = 0; public static final int View_paddingEnd = 3; public static final int View_paddingStart = 2; public static final int View_theme = 4; } }
package com.arzin.btrove; import android.os.Bundle; import android.preference.PreferenceActivity; public class Settings extends PreferenceActivity{ @SuppressWarnings("deprecation") @Override protected void onCreate(Bundle savedInstanceState) { // TODO Auto-generated method stub super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.settings_layout); } }
package mit.cadlab.dome3.api.demo.hla; import hla.rti1516.*; import se.pitch.prti1516.LogicalTimeDouble; public class AirplaneFederate extends TimeSynchronizedMessagingFederate { public static String AIRPLANE_1_ID = "AIRPLANE-1"; public static String AIRPLANE_2_ID = "AIRPLANE-2"; private int targetCount = 5; private double[] pictureTimePoints = null; private int nextPictureTimeIdx = 0; private int processedImageCounter = 0; private boolean finishedRunning = false; /** (ex) new AirplaneFederate("000", "C:/dome3/out/WarField.xml"); */ public AirplaneFederate(String instanceId, String sessionId, String filePath) { super(instanceId, sessionId, 1000, 1, 0.01, filePath); nextPictureTimeIdx = 0; processedImageCounter = 0; finishedRunning = false; } /** pictureTimePoints: when is the time point a picture taken event to be genereated? */ public void setPictureTakingSchedule(double[] timePoints) { this.pictureTimePoints = timePoints; this.nextPictureTimeIdx = 0; } /** tickInRealTime: how much of the real time is a tick equivalent to? */ public void setTargetCount(int targetCount) { this.targetCount = targetCount; } public boolean isFinished() { return finishedRunning; } public void run() { while (true) { isPaused = false; if (nextPictureTimeIdx < pictureTimePoints.length) { double nextPictureTimePoint = pictureTimePoints[nextPictureTimeIdx]; if (nextPictureTimePoint > getLocalTime() && nextPictureTimePoint <= getNextLocalTime()) { sendInteractionMessage(ImageProcessorFederate.IMGPROC_ID, "a picture taken", new LogicalTimeDouble(nextPictureTimePoint)); // addLog("sent a picture: MSG TIME=" + nf.format(nextPictureTimePoint) + ", AIRPLANE TIME=" + getLocalTime()); addLog("sent a picture: timestamped=" + nf.format(nextPictureTimePoint)); nextPictureTimeIdx++; } } /* wait for a certain amount of time before time-advancing */ try { Thread.sleep(tickInRealTime); } catch (InterruptedException e) { } isPaused = true; requestForTimeAdvance(); if (processedImageCounter >= targetCount) { addLog("mission complete: total " + processedImageCounter + " pictures are processed"); break; } } finishedRunning = true; } public final void receiveInteraction(InteractionClassHandle interaction, ParameterHandleValueMap valueMap, byte[] bytes, OrderType orderType, TransportationType transportationType, LogicalTime timeStampedTime, OrderType orderType1) { synchronized (reservationSemaphore) { if (interaction.equals(CID_COMMUNICATION)) { /* read message, sender, and receiver from interaction */ String message = new String((byte[]) valueMap.get(PID_MESSAGE)); String sender = new String((byte[]) valueMap.get(PID_SENDER)); String receiver = new String((byte[]) valueMap.get(PID_RECEIVER)); if (instanceId.equals(receiver)) { try { processedImageCounter++; double timeStampedTimeValue = ((LogicalTimeDouble) timeStampedTime).getValue(); addLog("received 'image processed': timestamped=" + nf.format(timeStampedTimeValue) + ", goal=" + processedImageCounter + "/" + targetCount); } catch (Exception e) { e.printStackTrace(); } } } } } }
package com.handcycle; import android.content.Intent; import android.os.Handler; import androidx.appcompat.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; public class SplashActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Log.d("SplashActivity", "Splash Screen Start"); new Handler().postDelayed(new Runnable() { @Override public void run() { Log.d("SplashActivity", "Splash Screen End"); // Jump to Login Page After 3 Seconds Intent i = new Intent(SplashActivity.this, LoginActivity.class); startActivity(i); finish(); } }, 3000); } }
/* * The MIT License (MIT) * * Copyright (c) 2007-2015 Broad Institute * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.broad.igv.feature.tribble; import org.broad.igv.Globals; import org.broad.igv.feature.BasicFeature; import org.broad.igv.feature.Exon; import org.broad.igv.feature.Strand; import org.broad.igv.feature.genome.Genome; import java.util.List; /** * @author Jim Robinson * @date 11/19/11 */ public class UCSCGeneTableCodec extends UCSCCodec<BasicFeature> { private int nameColumn = 0; private int idColumn = 1; private int chrColumn = 2; private int strandColumn = 3; private int startColumn = 4; private int endColumn = 5; private int cdStartColumn = 6; private int cdEndColumn = 7; private int exonCountColumn = 8; private int startsBufferColumn = 9; private int endsBufferColumn = 10; private int frameBufferColumn = 15; private int scoreColumn = -1; public enum Type { REFFLAT, GENEPRED, UCSCGENE, GENEPRED_EXT } private Genome genome; private Type type; public UCSCGeneTableCodec(Type type, Genome genome) { super(BasicFeature.class); this.genome = genome; this.type = type; switch (type) { case REFFLAT: break; case UCSCGENE: idColumn = 0; chrColumn = 1; strandColumn = 2; startColumn = 3; endColumn = 4; cdStartColumn = 5; cdEndColumn = 6; exonCountColumn = 7; startsBufferColumn = 8; endsBufferColumn = 9; nameColumn = 10; break; case GENEPRED_EXT: idColumn = 0; chrColumn = 1; strandColumn = 2; startColumn = 3; endColumn = 4; cdStartColumn = 5; cdEndColumn = 6; exonCountColumn = 7; startsBufferColumn = 8; endsBufferColumn = 9; scoreColumn = 10; nameColumn = 11; frameBufferColumn = 14; break; case GENEPRED: nameColumn = 12; } } /** * Decode a line as a Feature. * * @param line the input line to decode * @return Return the Feature encoded by the line, or null if the line does not represent a feature (e.g. is * a comment) */ public BasicFeature decode(String line) { if (line.startsWith("#")) { //Header line readHeaderLine(line); return null; } line = line.replaceAll("\"", ""); String[] tokens = Globals.tabPattern.split(line); int tokenCount = tokens.length; if (tokenCount <= strandColumn) { return null; } String identifier = tokens[idColumn].trim(); String name = null; if (tokenCount > nameColumn && tokens[nameColumn] != null) { name = tokens[nameColumn]; } if (name == null || name.length() == nameColumn) { name = identifier; } String chrToken = tokens[chrColumn].trim(); String chr = genome == null ? chrToken : genome.getCanonicalChrName(chrToken); int start = Integer.parseInt(tokens[startColumn]); int end = Integer.parseInt(tokens[endColumn]); String strandString = tokens[strandColumn]; Strand strand = Strand.NONE; if (strandString != null) { if (strandString.trim().equals("+")) { strand = Strand.POSITIVE; } else if (strandString.trim().equals("-")) { strand = Strand.NEGATIVE; } } BasicFeature gene = new BasicFeature(chr, start, end, strand); gene.setRepresentation(line); gene.setName(name); gene.setIdentifier(identifier); if (tokenCount > 7) { gene.setThickStart(Integer.parseInt(tokens[6])); gene.setThickEnd(Integer.parseInt(tokens[7])); } if(scoreColumn > 0 && tokenCount > scoreColumn) { gene.setScore((float) Double.parseDouble(tokens[scoreColumn])); } // Coding information is optional if (tokenCount > 8) { createExons(tokens, tokenCount, gene, chr, strand); } // Optional standard name column if (tokenCount > 16) { gene.setAttribute("Standard Name", tokens[16]); } return gene; } /** * This function returns true iff the File potentialInput can be parsed by this * codec. * <p/> * There is an assumption that there's never a situation where two different Codecs * return true for the same file. If this occurs, the recommendation would be to error out. * <p/> * Note this function must never throw an error. All errors should be trapped * and false returned. * * @param path the file to test for parsability with this codec * @return true if potentialInput can be parsed, false otherwise */ public boolean canDecode(String path) { return true; } private void createExons(String[] tokens, int tokenCount, BasicFeature gene, String chr, Strand strand) throws NumberFormatException { int cdStart = Integer.parseInt(tokens[cdStartColumn]); int cdEnd = Integer.parseInt(tokens[cdEndColumn]); int exonCount = Integer.parseInt(tokens[exonCountColumn]); String[] startsBuffer = Globals.commaPattern.split(tokens[startsBufferColumn]); String[] endsBuffer = Globals.commaPattern.split(tokens[endsBufferColumn]); if (startsBuffer.length == endsBuffer.length) { int exonNumber = (strand == Strand.NEGATIVE ? exonCount : 1); for (int i = 0; i < startsBuffer.length; i++) { int exonStart = Integer.parseInt(startsBuffer[i]); int exonEnd = Integer.parseInt(endsBuffer[i]); Exon exon = new Exon(chr, exonStart, exonEnd, strand); exon.setCodingStart(cdStart); exon.setCodingEnd(cdEnd); gene.addExon(exon); exon.setNumber(exonNumber); if (strand == Strand.NEGATIVE) { exonNumber--; } else { exonNumber++; } } } List<Exon> exons = gene.getExons(); // Walk through exons setting mRNA start position int start = strand == Strand.POSITIVE ? 0 : exonCount - 1; int end = strand == Strand.POSITIVE ? exonCount : -1; int increment = strand == Strand.POSITIVE ? 1 : -1; int mRNABase = 0; for (int i = start; i != end; i += increment) { Exon exon = exons.get(i); exon.setMrnaBase(mRNABase); mRNABase += exon.getCodingLength(); } if (type == Type.GENEPRED && tokenCount > 15) { String[] frameBuffer = Globals.commaPattern.split(tokens[frameBufferColumn]); for (int i = 0; i < frameBuffer.length; i++) { int exonFrame = Integer.parseInt(frameBuffer[i].trim()); if (exonFrame == -1) { exons.get(i).setNonCoding(true); } else { exons.get(i).setReadingFrame(exonFrame); } } } } }
package bookshop2.seller.incoming.orderBooks; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; import org.aries.message.Message; import org.aries.message.util.MessageConstants; import org.aries.tx.AbstractListenerForRMIUnitTest; import org.aries.util.FieldUtil; import org.aries.validate.util.CheckpointManager; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.runners.MockitoJUnitRunner; import bookshop2.BooksAvailableMessage; import bookshop2.seller.SellerContext; import bookshop2.util.Bookshop2Fixture; @RunWith(MockitoJUnitRunner.class) public class BooksAvailableListenerForRMIUnitTest extends AbstractListenerForRMIUnitTest { private BooksAvailableListenerForRMI fixture; private BooksAvailableInterceptor mockBooksAvailableInterceptor; private SellerContext mockSellerContext; @Override public String getServiceId() { return BooksAvailable.ID; } @Override public String getDomain() { return "bookshop2.seller"; } @Override public String getModule() { return "bookshop2-seller-service"; } public SellerContext getMockServiceContext() { return mockSellerContext; } @Before public void setUp() throws Exception { mockSellerContext = new SellerContext(); mockBooksAvailableInterceptor = mock(BooksAvailableInterceptor.class); CheckpointManager.setJAXBSessionCache(getJAXBSessionCache()); CheckpointManager.addConfiguration("bookshop2-seller-service-checks.xml"); super.setUp(); } @After public void tearDown() throws Exception { mockSellerContext = null; mockBooksAvailableInterceptor = null; fixture = null; super.tearDown(); } protected BooksAvailableListenerForRMI createFixture() throws Exception { fixture = new BooksAvailableListenerForRMI(); FieldUtil.setFieldValue(fixture, "sellerContext", mockSellerContext); FieldUtil.setFieldValue(fixture, "booksAvailableInterceptor", mockBooksAvailableInterceptor); initialize(fixture); return fixture; } @Test public void testExecute_booksAvailable_Success() throws Exception { BooksAvailableMessage booksAvailableMessage = Bookshop2Fixture.create_BooksAvailableMessage(); setupContext("dummyCorrelationId", "dummyTransactionId"); setupMessage(booksAvailableMessage); runTestExecute_booksAvailable(booksAvailableMessage); } @Test public void testExecute_booksAvailable_NullRequest() throws Exception { setupForExpectedAssertionFailure("BooksAvailableMessage"); setupContext("dummyCorrelationId", "dummyTransactionId"); isExpectedValidationError = true; runTestExecute_booksAvailable(null); } @Test public void testExecute_booksAvailable_EmptyRequest() throws Exception { setupForExpectedAssertionFailure("BooksAvailableMessage"); BooksAvailableMessage booksAvailableMessage = Bookshop2Fixture.createEmpty_BooksAvailableMessage(); setupContext("dummyCorrelationId", "dummyTransactionId"); setupMessage(booksAvailableMessage); isExpectedValidationError = true; runTestExecute_booksAvailable(booksAvailableMessage); } @Test public void testExecute_booksAvailable_NullCorrelationId() throws Exception { setupForExpectedAssertionFailure("CorrelationId null"); BooksAvailableMessage booksAvailableMessage = Bookshop2Fixture.create_BooksAvailableMessage(); setupContext(null, "dummyTransactionId"); setupMessage(booksAvailableMessage); isExpectedValidationError = true; runTestExecute_booksAvailable(booksAvailableMessage); } @Test public void testExecute_booksAvailable_EmptyCorrelationId() throws Exception { setupForExpectedAssertionFailure("CorrelationId empty"); BooksAvailableMessage booksAvailableMessage = Bookshop2Fixture.create_BooksAvailableMessage(); setupContext("", "dummyTransactionId"); setupMessage(booksAvailableMessage); isExpectedValidationError = true; runTestExecute_booksAvailable(booksAvailableMessage); } public void runTestExecute_booksAvailable(BooksAvailableMessage booksAvailableMessage) throws Exception { try { Message message = new Message(); message.addPart("booksAvailableMessage", booksAvailableMessage); message.addPart(MessageConstants.PROPERTY_OPERATION_NAME, "booksAvailable"); fixture = createFixture(); fixture.invoke(message, correlationId, 60000L); validateAfterInvocation(message); } catch (Throwable e) { validateAfterException(e); } finally { validateAfterExecution(); } } public void validateAfterInvocation(Message message) throws Exception { if (!isExpectedValidationError) verify(mockBooksAvailableInterceptor).booksAvailable(message); } }
package org.simpleflatmapper.datastax.impl; import com.datastax.driver.core.ResultSet; import com.datastax.driver.core.Row; import org.simpleflatmapper.util.Enumarable; public class ResultSetEnumarable implements Enumarable<Row> { private final ResultSet resultSet; private Row currentRow; public ResultSetEnumarable(ResultSet resultSet) { this.resultSet = resultSet; } @Override public boolean next() { if (resultSet.isExhausted()) return false; currentRow = resultSet.one(); return true; } @Override public Row currentValue() { return currentRow; } }
/* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.javaagent.instrumentation.spring.webflux.client; import static io.opentelemetry.javaagent.tooling.ClassLoaderMatcher.hasClassesNamed; import static io.opentelemetry.javaagent.tooling.bytebuddy.matcher.AgentElementMatchers.implementsInterface; import static java.util.Collections.singletonList; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.isPublic; import static net.bytebuddy.matcher.ElementMatchers.named; import com.google.auto.service.AutoService; import io.opentelemetry.javaagent.tooling.InstrumentationModule; import io.opentelemetry.javaagent.tooling.TypeInstrumentation; import java.util.List; import java.util.Map; import net.bytebuddy.description.method.MethodDescription; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; @AutoService(InstrumentationModule.class) public class WebfluxClientInstrumentationModule extends InstrumentationModule { public WebfluxClientInstrumentationModule() { super("spring-webflux", "spring-webflux-5.0", "spring-webflux-client"); } @Override public List<TypeInstrumentation> typeInstrumentations() { return singletonList(new WebClientBuilderInstrumentation()); } private static final class WebClientBuilderInstrumentation implements TypeInstrumentation { @Override public ElementMatcher<ClassLoader> classLoaderOptimization() { return hasClassesNamed("org.springframework.web.reactive.function.client.WebClient"); } @Override public ElementMatcher<? super TypeDescription> typeMatcher() { return implementsInterface( named("org.springframework.web.reactive.function.client.WebClient$Builder")); } @Override public Map<? extends ElementMatcher<? super MethodDescription>, String> transformers() { return singletonMap( isMethod().and(isPublic()).and(named("build")), WebClientFilterAdvice.class.getName()); } } }
package com.github.badoualy.telegram.tl.api.request; import com.github.badoualy.telegram.tl.TLContext; import com.github.badoualy.telegram.tl.api.TLAbsInputUser; import com.github.badoualy.telegram.tl.api.TLAbsUpdates; import com.github.badoualy.telegram.tl.core.TLMethod; import com.github.badoualy.telegram.tl.core.TLObject; import com.github.badoualy.telegram.tl.core.TLVector; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import static com.github.badoualy.telegram.tl.StreamUtils.readTLObject; import static com.github.badoualy.telegram.tl.StreamUtils.readTLString; import static com.github.badoualy.telegram.tl.StreamUtils.readTLVector; import static com.github.badoualy.telegram.tl.StreamUtils.writeString; import static com.github.badoualy.telegram.tl.StreamUtils.writeTLVector; import static com.github.badoualy.telegram.tl.TLObjectUtils.SIZE_CONSTRUCTOR_ID; import static com.github.badoualy.telegram.tl.TLObjectUtils.computeTLStringSerializedSize; /** * @author Yannick Badoual yann.badoual@gmail.com * @see <a href="http://github.com/badoualy/kotlogram">http://github.com/badoualy/kotlogram</a> */ public class TLRequestMessagesCreateChat extends TLMethod<TLAbsUpdates> { public static final int CONSTRUCTOR_ID = 0x9cb126e; protected TLVector<TLAbsInputUser> users; protected String title; private final String _constructor = "messages.createChat#9cb126e"; public TLRequestMessagesCreateChat() { } public TLRequestMessagesCreateChat(TLVector<TLAbsInputUser> users, String title) { this.users = users; this.title = title; } @Override @SuppressWarnings({"unchecked", "SimplifiableConditionalExpression"}) public TLAbsUpdates deserializeResponse(InputStream stream, TLContext context) throws IOException { final TLObject response = readTLObject(stream, context); if (response == null) { throw new IOException("Unable to parse response"); } if (!(response instanceof TLAbsUpdates)) { throw new IOException( "Incorrect response type, expected " + getClass().getCanonicalName() + ", found " + response .getClass().getCanonicalName()); } return (TLAbsUpdates) response; } @Override public void serializeBody(OutputStream stream) throws IOException { writeTLVector(users, stream); writeString(title, stream); } @Override @SuppressWarnings({"unchecked", "SimplifiableConditionalExpression"}) public void deserializeBody(InputStream stream, TLContext context) throws IOException { users = readTLVector(stream, context); title = readTLString(stream); } @Override public int computeSerializedSize() { int size = SIZE_CONSTRUCTOR_ID; size += users.computeSerializedSize(); size += computeTLStringSerializedSize(title); return size; } @Override public String toString() { return _constructor; } @Override public int getConstructorId() { return CONSTRUCTOR_ID; } public TLVector<TLAbsInputUser> getUsers() { return users; } public void setUsers(TLVector<TLAbsInputUser> users) { this.users = users; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } }
package com.hbelmiro.microprofile.cdi; import io.quarkus.test.junit.NativeImageTest; @NativeImageTest public class NativeExampleResourceIT extends ExampleResourceTest { // Execute the same tests but in native mode. }
package com.alanlapierre.merchants.repository; import org.springframework.data.jpa.repository.JpaRepository; import com.alanlapierre.merchants.model.Plan; public interface PlanRepository extends JpaRepository<Plan, Long> { }
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ package com.facebook.react.uimanager; import android.os.SystemClock; import android.view.View; import androidx.annotation.GuardedBy; import androidx.annotation.Nullable; import com.facebook.common.logging.FLog; import com.facebook.react.bridge.Callback; import com.facebook.react.bridge.GuardedRunnable; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContext; import com.facebook.react.bridge.ReadableArray; import com.facebook.react.bridge.ReadableMap; import com.facebook.react.bridge.SoftAssertions; import com.facebook.react.bridge.UiThreadUtil; import com.facebook.react.common.ReactConstants; import com.facebook.react.modules.core.ReactChoreographer; import com.facebook.react.uimanager.debug.NotThreadSafeViewHierarchyUpdateDebugListener; import com.facebook.systrace.Systrace; import com.facebook.systrace.SystraceMessage; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; /** * This class acts as a buffer for command executed on {@link NativeViewHierarchyManager}. It expose * similar methods as mentioned classes but instead of executing commands immediately it enqueues * those operations in a queue that is then flushed from {@link UIManagerModule} once JS batch of ui * operations is finished. This is to make sure that we execute all the JS operation coming from a * single batch a single loop of the main (UI) android looper. * * <p>TODO(7135923): Pooling of operation objects TODO(5694019): Consider a better data structure * for operations queue to save on allocations */ public class UIViewOperationQueue { public static final int DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS = 8; private final int[] mMeasureBuffer = new int[4]; /** A mutation or animation operation on the view hierarchy. */ public interface UIOperation { void execute(); } /** A spec for an operation on the native View hierarchy. */ private abstract class ViewOperation implements UIOperation { public int mTag; public ViewOperation(int tag) { mTag = tag; } } private final class RemoveRootViewOperation extends ViewOperation { public RemoveRootViewOperation(int tag) { super(tag); } @Override public void execute() { mNativeViewHierarchyManager.removeRootView(mTag); } } private final class UpdatePropertiesOperation extends ViewOperation { private final ReactStylesDiffMap mProps; private UpdatePropertiesOperation(int tag, ReactStylesDiffMap props) { super(tag); mProps = props; } @Override public void execute() { mNativeViewHierarchyManager.updateProperties(mTag, mProps); } } private final class EmitOnLayoutEventOperation extends ViewOperation { private final int mScreenX; private final int mScreenY; private final int mScreenWidth; private final int mScreenHeight; public EmitOnLayoutEventOperation( int tag, int screenX, int screenY, int screenWidth, int screenHeight) { super(tag); mScreenX = screenX; mScreenY = screenY; mScreenWidth = screenWidth; mScreenHeight = screenHeight; } @Override public void execute() { mReactApplicationContext .getNativeModule(UIManagerModule.class) .getEventDispatcher() .dispatchEvent( OnLayoutEvent.obtain(mTag, mScreenX, mScreenY, mScreenWidth, mScreenHeight)); } } private final class UpdateInstanceHandleOperation extends ViewOperation { private final long mInstanceHandle; private UpdateInstanceHandleOperation(int tag, long instanceHandle) { super(tag); mInstanceHandle = instanceHandle; } @Override public void execute() { mNativeViewHierarchyManager.updateInstanceHandle(mTag, mInstanceHandle); } } /** * Operation for updating native view's position and size. The operation is not created directly * by a {@link UIManagerModule} call from JS. Instead it gets inflated using computed position and * size values by CSSNodeDEPRECATED hierarchy. */ private final class UpdateLayoutOperation extends ViewOperation { private final int mParentTag, mX, mY, mWidth, mHeight; public UpdateLayoutOperation(int parentTag, int tag, int x, int y, int width, int height) { super(tag); mParentTag = parentTag; mX = x; mY = y; mWidth = width; mHeight = height; Systrace.startAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "updateLayout", mTag); } @Override public void execute() { Systrace.endAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "updateLayout", mTag); mNativeViewHierarchyManager.updateLayout(mParentTag, mTag, mX, mY, mWidth, mHeight); } } private final class CreateViewOperation extends ViewOperation { private final ThemedReactContext mThemedContext; private final String mClassName; private final @Nullable ReactStylesDiffMap mInitialProps; public CreateViewOperation( ThemedReactContext themedContext, int tag, String className, @Nullable ReactStylesDiffMap initialProps) { super(tag); mThemedContext = themedContext; mClassName = className; mInitialProps = initialProps; Systrace.startAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "createView", mTag); } @Override public void execute() { Systrace.endAsyncFlow(Systrace.TRACE_TAG_REACT_VIEW, "createView", mTag); mNativeViewHierarchyManager.createView(mThemedContext, mTag, mClassName, mInitialProps); } } private final class ManageChildrenOperation extends ViewOperation { private final @Nullable int[] mIndicesToRemove; private final @Nullable ViewAtIndex[] mViewsToAdd; private final @Nullable int[] mTagsToDelete; private final @Nullable int[] mIndicesToDelete; public ManageChildrenOperation( int tag, @Nullable int[] indicesToRemove, @Nullable ViewAtIndex[] viewsToAdd, @Nullable int[] tagsToDelete, @Nullable int[] indicesToDelete) { super(tag); mIndicesToRemove = indicesToRemove; mViewsToAdd = viewsToAdd; mTagsToDelete = tagsToDelete; mIndicesToDelete = indicesToDelete; } @Override public void execute() { mNativeViewHierarchyManager.manageChildren( mTag, mIndicesToRemove, mViewsToAdd, mTagsToDelete, mIndicesToDelete); } } private final class SetChildrenOperation extends ViewOperation { private final ReadableArray mChildrenTags; public SetChildrenOperation(int tag, ReadableArray childrenTags) { super(tag); mChildrenTags = childrenTags; } @Override public void execute() { mNativeViewHierarchyManager.setChildren(mTag, mChildrenTags); } } private final class UpdateViewExtraData extends ViewOperation { private final Object mExtraData; public UpdateViewExtraData(int tag, Object extraData) { super(tag); mExtraData = extraData; } @Override public void execute() { mNativeViewHierarchyManager.updateViewExtraData(mTag, mExtraData); } } private final class ChangeJSResponderOperation extends ViewOperation { private final int mInitialTag; private final boolean mBlockNativeResponder; private final boolean mClearResponder; public ChangeJSResponderOperation( int tag, int initialTag, boolean clearResponder, boolean blockNativeResponder) { super(tag); mInitialTag = initialTag; mClearResponder = clearResponder; mBlockNativeResponder = blockNativeResponder; } @Override public void execute() { if (!mClearResponder) { mNativeViewHierarchyManager.setJSResponder(mTag, mInitialTag, mBlockNativeResponder); } else { mNativeViewHierarchyManager.clearJSResponder(); } } } @Deprecated private final class DispatchCommandOperation extends ViewOperation { private final int mCommand; private final @Nullable ReadableArray mArgs; public DispatchCommandOperation(int tag, int command, @Nullable ReadableArray args) { super(tag); mCommand = command; mArgs = args; } @Override public void execute() { mNativeViewHierarchyManager.dispatchCommand(mTag, mCommand, mArgs); } } private final class DispatchStringCommandOperation extends ViewOperation { private final String mCommand; private final @Nullable ReadableArray mArgs; public DispatchStringCommandOperation(int tag, String command, @Nullable ReadableArray args) { super(tag); mCommand = command; mArgs = args; } @Override public void execute() { mNativeViewHierarchyManager.dispatchCommand(mTag, mCommand, mArgs); } } private final class ShowPopupMenuOperation extends ViewOperation { private final ReadableArray mItems; private final Callback mError; private final Callback mSuccess; public ShowPopupMenuOperation(int tag, ReadableArray items, Callback error, Callback success) { super(tag); mItems = items; mError = error; mSuccess = success; } @Override public void execute() { mNativeViewHierarchyManager.showPopupMenu(mTag, mItems, mSuccess, mError); } } private final class DismissPopupMenuOperation implements UIOperation { @Override public void execute() { mNativeViewHierarchyManager.dismissPopupMenu(); } } /** A spec for animation operations (add/remove) */ private abstract static class AnimationOperation implements UIViewOperationQueue.UIOperation { protected final int mAnimationID; public AnimationOperation(int animationID) { mAnimationID = animationID; } } private class SetLayoutAnimationEnabledOperation implements UIOperation { private final boolean mEnabled; private SetLayoutAnimationEnabledOperation(final boolean enabled) { mEnabled = enabled; } @Override public void execute() { mNativeViewHierarchyManager.setLayoutAnimationEnabled(mEnabled); } } private class ConfigureLayoutAnimationOperation implements UIOperation { private final ReadableMap mConfig; private final Callback mAnimationComplete; private ConfigureLayoutAnimationOperation( final ReadableMap config, final Callback animationComplete) { mConfig = config; mAnimationComplete = animationComplete; } @Override public void execute() { mNativeViewHierarchyManager.configureLayoutAnimation(mConfig, mAnimationComplete); } } private final class MeasureOperation implements UIOperation { private final int mReactTag; private final Callback mCallback; private MeasureOperation(final int reactTag, final Callback callback) { super(); mReactTag = reactTag; mCallback = callback; } @Override public void execute() { try { mNativeViewHierarchyManager.measure(mReactTag, mMeasureBuffer); } catch (NoSuchNativeViewException e) { // Invoke with no args to signal failure and to allow JS to clean up the callback // handle. mCallback.invoke(); return; } float x = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]); float y = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]); float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]); float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]); mCallback.invoke(0, 0, width, height, x, y); } } private final class MeasureInWindowOperation implements UIOperation { private final int mReactTag; private final Callback mCallback; private MeasureInWindowOperation(final int reactTag, final Callback callback) { super(); mReactTag = reactTag; mCallback = callback; } @Override public void execute() { try { mNativeViewHierarchyManager.measureInWindow(mReactTag, mMeasureBuffer); } catch (NoSuchNativeViewException e) { // Invoke with no args to signal failure and to allow JS to clean up the callback // handle. mCallback.invoke(); return; } float x = PixelUtil.toDIPFromPixel(mMeasureBuffer[0]); float y = PixelUtil.toDIPFromPixel(mMeasureBuffer[1]); float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]); float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]); mCallback.invoke(x, y, width, height); } } private final class FindTargetForTouchOperation implements UIOperation { private final int mReactTag; private final float mTargetX; private final float mTargetY; private final Callback mCallback; private FindTargetForTouchOperation( final int reactTag, final float targetX, final float targetY, final Callback callback) { super(); mReactTag = reactTag; mTargetX = targetX; mTargetY = targetY; mCallback = callback; } @Override public void execute() { try { mNativeViewHierarchyManager.measure(mReactTag, mMeasureBuffer); } catch (IllegalViewOperationException e) { mCallback.invoke(); return; } // Because React coordinates are relative to root container, and measure() operates // on screen coordinates, we need to offset values using root container location. final float containerX = (float) mMeasureBuffer[0]; final float containerY = (float) mMeasureBuffer[1]; final int touchTargetReactTag = mNativeViewHierarchyManager.findTargetTagForTouch(mReactTag, mTargetX, mTargetY); try { mNativeViewHierarchyManager.measure(touchTargetReactTag, mMeasureBuffer); } catch (IllegalViewOperationException e) { mCallback.invoke(); return; } float x = PixelUtil.toDIPFromPixel(mMeasureBuffer[0] - containerX); float y = PixelUtil.toDIPFromPixel(mMeasureBuffer[1] - containerY); float width = PixelUtil.toDIPFromPixel(mMeasureBuffer[2]); float height = PixelUtil.toDIPFromPixel(mMeasureBuffer[3]); mCallback.invoke(touchTargetReactTag, x, y, width, height); } } private final class LayoutUpdateFinishedOperation implements UIOperation { private final ReactShadowNode mNode; private final UIImplementation.LayoutUpdateListener mListener; private LayoutUpdateFinishedOperation( ReactShadowNode node, UIImplementation.LayoutUpdateListener listener) { mNode = node; mListener = listener; } @Override public void execute() { mListener.onLayoutUpdated(mNode); } } private class UIBlockOperation implements UIOperation { private final UIBlock mBlock; public UIBlockOperation(UIBlock block) { mBlock = block; } @Override public void execute() { mBlock.execute(mNativeViewHierarchyManager); } } private final class SendAccessibilityEvent extends ViewOperation { private final int mEventType; private SendAccessibilityEvent(int tag, int eventType) { super(tag); mEventType = eventType; } @Override public void execute() { mNativeViewHierarchyManager.sendAccessibilityEvent(mTag, mEventType); } } private final NativeViewHierarchyManager mNativeViewHierarchyManager; private final Object mDispatchRunnablesLock = new Object(); private final Object mNonBatchedOperationsLock = new Object(); private final DispatchUIFrameCallback mDispatchUIFrameCallback; private final ReactApplicationContext mReactApplicationContext; // Only called from the UIManager queue? private ArrayList<UIOperation> mOperations = new ArrayList<>(); @GuardedBy("mDispatchRunnablesLock") private ArrayList<Runnable> mDispatchUIRunnables = new ArrayList<>(); @GuardedBy("mNonBatchedOperationsLock") private ArrayDeque<UIOperation> mNonBatchedOperations = new ArrayDeque<>(); private @Nullable NotThreadSafeViewHierarchyUpdateDebugListener mViewHierarchyUpdateDebugListener; private boolean mIsDispatchUIFrameCallbackEnqueued = false; private boolean mIsInIllegalUIState = false; private boolean mIsProfilingNextBatch = false; private long mNonBatchedExecutionTotalTime; private long mProfiledBatchCommitStartTime; private long mProfiledBatchCommitEndTime; private long mProfiledBatchLayoutTime; private long mProfiledBatchDispatchViewUpdatesTime; private long mProfiledBatchRunStartTime; private long mProfiledBatchRunEndTime; private long mProfiledBatchBatchedExecutionTime; private long mProfiledBatchNonBatchedExecutionTime; private long mThreadCpuTime; private long mCreateViewCount; private long mUpdatePropertiesOperationCount; public UIViewOperationQueue( ReactApplicationContext reactContext, NativeViewHierarchyManager nativeViewHierarchyManager, int minTimeLeftInFrameForNonBatchedOperationMs) { mNativeViewHierarchyManager = nativeViewHierarchyManager; mDispatchUIFrameCallback = new DispatchUIFrameCallback( reactContext, minTimeLeftInFrameForNonBatchedOperationMs == -1 ? DEFAULT_MIN_TIME_LEFT_IN_FRAME_FOR_NONBATCHED_OPERATION_MS : minTimeLeftInFrameForNonBatchedOperationMs); mReactApplicationContext = reactContext; } /*package*/ NativeViewHierarchyManager getNativeViewHierarchyManager() { return mNativeViewHierarchyManager; } public void setViewHierarchyUpdateDebugListener( @Nullable NotThreadSafeViewHierarchyUpdateDebugListener listener) { mViewHierarchyUpdateDebugListener = listener; } public void profileNextBatch() { mIsProfilingNextBatch = true; mProfiledBatchCommitStartTime = 0; mCreateViewCount = 0; mUpdatePropertiesOperationCount = 0; } public Map<String, Long> getProfiledBatchPerfCounters() { Map<String, Long> perfMap = new HashMap<>(); perfMap.put("CommitStartTime", mProfiledBatchCommitStartTime); perfMap.put("CommitEndTime", mProfiledBatchCommitEndTime); perfMap.put("LayoutTime", mProfiledBatchLayoutTime); perfMap.put("DispatchViewUpdatesTime", mProfiledBatchDispatchViewUpdatesTime); perfMap.put("RunStartTime", mProfiledBatchRunStartTime); perfMap.put("RunEndTime", mProfiledBatchRunEndTime); perfMap.put("BatchedExecutionTime", mProfiledBatchBatchedExecutionTime); perfMap.put("NonBatchedExecutionTime", mProfiledBatchNonBatchedExecutionTime); perfMap.put("NativeModulesThreadCpuTime", mThreadCpuTime); perfMap.put("CreateViewCount", mCreateViewCount); perfMap.put("UpdatePropsCount", mUpdatePropertiesOperationCount); return perfMap; } public boolean isEmpty() { return mOperations.isEmpty(); } public void addRootView(final int tag, final View rootView) { mNativeViewHierarchyManager.addRootView(tag, rootView); } /** * Enqueues a UIOperation to be executed in UI thread. This method should only be used by a * subclass to support UIOperations not provided by UIViewOperationQueue. */ protected void enqueueUIOperation(UIOperation operation) { SoftAssertions.assertNotNull(operation); mOperations.add(operation); } public void enqueueRemoveRootView(int rootViewTag) { mOperations.add(new RemoveRootViewOperation(rootViewTag)); } public void enqueueSetJSResponder(int tag, int initialTag, boolean blockNativeResponder) { mOperations.add( new ChangeJSResponderOperation( tag, initialTag, false /*clearResponder*/, blockNativeResponder)); } public void enqueueClearJSResponder() { // Tag is 0 because JSResponderHandler doesn't need one in order to clear the responder. mOperations.add(new ChangeJSResponderOperation(0, 0, true /*clearResponder*/, false)); } @Deprecated public void enqueueDispatchCommand( int reactTag, int commandId, @Nullable ReadableArray commandArgs) { mOperations.add(new DispatchCommandOperation(reactTag, commandId, commandArgs)); } public void enqueueDispatchCommand( int reactTag, String commandId, @Nullable ReadableArray commandArgs) { mOperations.add(new DispatchStringCommandOperation(reactTag, commandId, commandArgs)); } public void enqueueUpdateExtraData(int reactTag, Object extraData) { mOperations.add(new UpdateViewExtraData(reactTag, extraData)); } public void enqueueShowPopupMenu( int reactTag, ReadableArray items, Callback error, Callback success) { mOperations.add(new ShowPopupMenuOperation(reactTag, items, error, success)); } public void enqueueDismissPopupMenu() { mOperations.add(new DismissPopupMenuOperation()); } public void enqueueCreateView( ThemedReactContext themedContext, int viewReactTag, String viewClassName, @Nullable ReactStylesDiffMap initialProps) { synchronized (mNonBatchedOperationsLock) { mCreateViewCount++; mNonBatchedOperations.addLast( new CreateViewOperation(themedContext, viewReactTag, viewClassName, initialProps)); } } public void enqueueUpdateInstanceHandle(int reactTag, long instanceHandle) { mOperations.add(new UpdateInstanceHandleOperation(reactTag, instanceHandle)); } public void enqueueUpdateProperties(int reactTag, String className, ReactStylesDiffMap props) { mUpdatePropertiesOperationCount++; mOperations.add(new UpdatePropertiesOperation(reactTag, props)); } public void enqueueOnLayoutEvent( int tag, int screenX, int screenY, int screenWidth, int screenHeight) { mOperations.add( new EmitOnLayoutEventOperation(tag, screenX, screenY, screenWidth, screenHeight)); } public void enqueueUpdateLayout( int parentTag, int reactTag, int x, int y, int width, int height) { mOperations.add(new UpdateLayoutOperation(parentTag, reactTag, x, y, width, height)); } public void enqueueManageChildren( int reactTag, @Nullable int[] indicesToRemove, @Nullable ViewAtIndex[] viewsToAdd, @Nullable int[] tagsToDelete, @Nullable int[] indicesToDelete) { mOperations.add( new ManageChildrenOperation( reactTag, indicesToRemove, viewsToAdd, tagsToDelete, indicesToDelete)); } public void enqueueSetChildren(int reactTag, ReadableArray childrenTags) { mOperations.add(new SetChildrenOperation(reactTag, childrenTags)); } public void enqueueSetLayoutAnimationEnabled(final boolean enabled) { mOperations.add(new SetLayoutAnimationEnabledOperation(enabled)); } public void enqueueConfigureLayoutAnimation( final ReadableMap config, final Callback onAnimationComplete) { mOperations.add(new ConfigureLayoutAnimationOperation(config, onAnimationComplete)); } public void enqueueMeasure(final int reactTag, final Callback callback) { mOperations.add(new MeasureOperation(reactTag, callback)); } public void enqueueMeasureInWindow(final int reactTag, final Callback callback) { mOperations.add(new MeasureInWindowOperation(reactTag, callback)); } public void enqueueFindTargetForTouch( final int reactTag, final float targetX, final float targetY, final Callback callback) { mOperations.add(new FindTargetForTouchOperation(reactTag, targetX, targetY, callback)); } public void enqueueSendAccessibilityEvent(int tag, int eventType) { mOperations.add(new SendAccessibilityEvent(tag, eventType)); } public void enqueueLayoutUpdateFinished( ReactShadowNode node, UIImplementation.LayoutUpdateListener listener) { mOperations.add(new LayoutUpdateFinishedOperation(node, listener)); } public void enqueueUIBlock(UIBlock block) { mOperations.add(new UIBlockOperation(block)); } public void prependUIBlock(UIBlock block) { mOperations.add(0, new UIBlockOperation(block)); } public void dispatchViewUpdates( final int batchId, final long commitStartTime, final long layoutTime) { SystraceMessage.beginSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "UIViewOperationQueue.dispatchViewUpdates") .arg("batchId", batchId) .flush(); try { final long dispatchViewUpdatesTime = SystemClock.uptimeMillis(); final long nativeModulesThreadCpuTime = SystemClock.currentThreadTimeMillis(); // Store the current operation queues to dispatch and create new empty ones to continue // receiving new operations final ArrayList<UIOperation> batchedOperations; if (!mOperations.isEmpty()) { batchedOperations = mOperations; mOperations = new ArrayList<>(); } else { batchedOperations = null; } final ArrayDeque<UIOperation> nonBatchedOperations; synchronized (mNonBatchedOperationsLock) { if (!mNonBatchedOperations.isEmpty()) { nonBatchedOperations = mNonBatchedOperations; mNonBatchedOperations = new ArrayDeque<>(); } else { nonBatchedOperations = null; } } if (mViewHierarchyUpdateDebugListener != null) { mViewHierarchyUpdateDebugListener.onViewHierarchyUpdateEnqueued(); } Runnable runOperations = new Runnable() { @Override public void run() { SystraceMessage.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "DispatchUI") .arg("BatchId", batchId) .flush(); try { long runStartTime = SystemClock.uptimeMillis(); // All nonBatchedOperations should be executed before regular operations as // regular operations may depend on them if (nonBatchedOperations != null) { for (UIOperation op : nonBatchedOperations) { op.execute(); } } if (batchedOperations != null) { for (UIOperation op : batchedOperations) { op.execute(); } } if (mIsProfilingNextBatch && mProfiledBatchCommitStartTime == 0) { mProfiledBatchCommitStartTime = commitStartTime; mProfiledBatchCommitEndTime = SystemClock.uptimeMillis(); mProfiledBatchLayoutTime = layoutTime; mProfiledBatchDispatchViewUpdatesTime = dispatchViewUpdatesTime; mProfiledBatchRunStartTime = runStartTime; mProfiledBatchRunEndTime = mProfiledBatchCommitEndTime; mThreadCpuTime = nativeModulesThreadCpuTime; Systrace.beginAsyncSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "delayBeforeDispatchViewUpdates", 0, mProfiledBatchCommitStartTime * 1000000); Systrace.endAsyncSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "delayBeforeDispatchViewUpdates", 0, mProfiledBatchDispatchViewUpdatesTime * 1000000); Systrace.beginAsyncSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "delayBeforeBatchRunStart", 0, mProfiledBatchDispatchViewUpdatesTime * 1000000); Systrace.endAsyncSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "delayBeforeBatchRunStart", 0, mProfiledBatchRunStartTime * 1000000); } // Clear layout animation, as animation only apply to current UI operations batch. mNativeViewHierarchyManager.clearLayoutAnimation(); if (mViewHierarchyUpdateDebugListener != null) { mViewHierarchyUpdateDebugListener.onViewHierarchyUpdateFinished(); } } catch (Exception e) { mIsInIllegalUIState = true; throw e; } finally { Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); } } }; SystraceMessage.beginSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "acquiring mDispatchRunnablesLock") .arg("batchId", batchId) .flush(); synchronized (mDispatchRunnablesLock) { Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); mDispatchUIRunnables.add(runOperations); } // In the case where the frame callback isn't enqueued, the UI isn't being displayed or is // being // destroyed. In this case it's no longer important to align to frames, but it is important to // make // sure any late-arriving UI commands are executed. if (!mIsDispatchUIFrameCallbackEnqueued) { UiThreadUtil.runOnUiThread( new GuardedRunnable(mReactApplicationContext) { @Override public void runGuarded() { flushPendingBatches(); } }); } } finally { Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); } } /* package */ void resumeFrameCallback() { mIsDispatchUIFrameCallbackEnqueued = true; ReactChoreographer.getInstance() .postFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, mDispatchUIFrameCallback); } /* package */ void pauseFrameCallback() { mIsDispatchUIFrameCallbackEnqueued = false; ReactChoreographer.getInstance() .removeFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, mDispatchUIFrameCallback); flushPendingBatches(); } private void flushPendingBatches() { if (mIsInIllegalUIState) { FLog.w( ReactConstants.TAG, "Not flushing pending UI operations because of previously thrown Exception"); return; } final ArrayList<Runnable> runnables; synchronized (mDispatchRunnablesLock) { if (!mDispatchUIRunnables.isEmpty()) { runnables = mDispatchUIRunnables; mDispatchUIRunnables = new ArrayList<>(); } else { return; } } final long batchedExecutionStartTime = SystemClock.uptimeMillis(); for (Runnable runnable : runnables) { runnable.run(); } if (mIsProfilingNextBatch) { mProfiledBatchBatchedExecutionTime = SystemClock.uptimeMillis() - batchedExecutionStartTime; mProfiledBatchNonBatchedExecutionTime = mNonBatchedExecutionTotalTime; mIsProfilingNextBatch = false; Systrace.beginAsyncSection( Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "batchedExecutionTime", 0, batchedExecutionStartTime * 1000000); Systrace.endAsyncSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "batchedExecutionTime", 0); } mNonBatchedExecutionTotalTime = 0; } /** * Choreographer FrameCallback responsible for actually dispatching view updates on the UI thread * that were enqueued via {@link #dispatchViewUpdates(int)}. The reason we don't just enqueue * directly to the UI thread from that method is to make sure our Runnables actually run before * the next traversals happen: * * <p>ViewRootImpl#scheduleTraversals (which is called from invalidate, requestLayout, etc) calls * Looper#postSyncBarrier which keeps any UI thread looper messages from being processed until * that barrier is removed during the next traversal. That means, depending on when we get updates * from JS and what else is happening on the UI thread, we can sometimes try to post this runnable * after ViewRootImpl has posted a barrier. * * <p>Using a Choreographer callback (which runs immediately before traversals), we guarantee we * run before the next traversal. */ private class DispatchUIFrameCallback extends GuardedFrameCallback { private static final int FRAME_TIME_MS = 16; private final int mMinTimeLeftInFrameForNonBatchedOperationMs; private DispatchUIFrameCallback( ReactContext reactContext, int minTimeLeftInFrameForNonBatchedOperationMs) { super(reactContext); mMinTimeLeftInFrameForNonBatchedOperationMs = minTimeLeftInFrameForNonBatchedOperationMs; } @Override public void doFrameGuarded(long frameTimeNanos) { if (mIsInIllegalUIState) { FLog.w( ReactConstants.TAG, "Not flushing pending UI operations because of previously thrown Exception"); return; } Systrace.beginSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE, "dispatchNonBatchedUIOperations"); try { dispatchPendingNonBatchedOperations(frameTimeNanos); } finally { Systrace.endSection(Systrace.TRACE_TAG_REACT_JAVA_BRIDGE); } flushPendingBatches(); ReactChoreographer.getInstance() .postFrameCallback(ReactChoreographer.CallbackType.DISPATCH_UI, this); } private void dispatchPendingNonBatchedOperations(long frameTimeNanos) { while (true) { long timeLeftInFrame = FRAME_TIME_MS - ((System.nanoTime() - frameTimeNanos) / 1000000); if (timeLeftInFrame < mMinTimeLeftInFrameForNonBatchedOperationMs) { break; } UIOperation nextOperation; synchronized (mNonBatchedOperationsLock) { if (mNonBatchedOperations.isEmpty()) { break; } nextOperation = mNonBatchedOperations.pollFirst(); } try { long nonBatchedExecutionStartTime = SystemClock.uptimeMillis(); nextOperation.execute(); mNonBatchedExecutionTotalTime += SystemClock.uptimeMillis() - nonBatchedExecutionStartTime; } catch (Exception e) { mIsInIllegalUIState = true; throw e; } } } } }
package org.apache.maven.model; /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ import junit.framework.TestCase; /** * Tests {@code MailingList}. * * @author Benjamin Bentmann */ public class MailingListTest extends TestCase { public void testHashCodeNullSafe() { new MailingList().hashCode(); } public void testEqualsNullSafe() { assertFalse( new MailingList().equals( null ) ); new MailingList().equals( new MailingList() ); } public void testEqualsIdentity() { MailingList thing = new MailingList(); assertTrue( thing.equals( thing ) ); } public void testToStringNullSafe() { assertNotNull( new MailingList().toString() ); } }
/** * Copyright 2005-2019 The Kuali Foundation * * Licensed under the Educational Community 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.opensource.org/licenses/ecl2.php * * 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.kuali.rice.krad.lookup; import java.util.HashMap; import java.util.Map; import org.apache.commons.lang.StringUtils; import org.kuali.rice.core.api.util.ConcreteKeyValue; import org.kuali.rice.krad.datadictionary.AttributeDefinition; import org.kuali.rice.krad.datadictionary.parse.BeanTag; import org.kuali.rice.krad.datadictionary.parse.BeanTagAttribute; import org.kuali.rice.krad.datadictionary.validation.constraint.ValidCharactersConstraint; import org.kuali.rice.krad.service.KRADServiceLocatorWeb; import org.kuali.rice.krad.uif.UifConstants; import org.kuali.rice.krad.uif.UifPropertyPaths; import org.kuali.rice.krad.uif.control.CheckboxControl; import org.kuali.rice.krad.uif.control.Control; import org.kuali.rice.krad.uif.control.FilterableLookupCriteriaControl; import org.kuali.rice.krad.uif.control.MultiValueControl; import org.kuali.rice.krad.uif.control.RadioGroupControl; import org.kuali.rice.krad.uif.control.TextAreaControl; import org.kuali.rice.krad.uif.element.Message; import org.kuali.rice.krad.uif.field.InputField; import org.kuali.rice.krad.uif.field.InputFieldBase; import org.kuali.rice.krad.uif.lifecycle.ViewLifecycle; import org.kuali.rice.krad.uif.util.ComponentFactory; import org.kuali.rice.krad.uif.util.ComponentUtils; import org.kuali.rice.krad.uif.util.KeyMessage; import org.kuali.rice.krad.uif.util.LifecycleElement; import org.kuali.rice.krad.util.KRADConstants; import org.kuali.rice.krad.util.KRADPropertyConstants; /** * Custom {@link InputField} for criteria fields within a lookup view that adds criteria specific options. * * @author Kuali Rice Team (rice.collab@kuali.org) */ @BeanTag(name = "lookupCriteria", parent = "Uif-LookupCriteriaInputField") public class LookupInputField extends InputFieldBase { private static final long serialVersionUID = -8294275596836322699L; private boolean disableWildcardsAndOperators; private boolean addControlSelectAllOption; private boolean ranged; public LookupInputField() { super(); } /** * The following actions are performed: * * <ul> * <li>Add all option if enabled and control is multi-value</li> * </ul> * * {@inheritDoc} */ @Override public void performFinalize(Object model, LifecycleElement parent) { super.performFinalize(model, parent); // if enabled add option to select all values if (addControlSelectAllOption && (getControl() != null) && getControl() instanceof MultiValueControl) { String allOptionText = KRADServiceLocatorWeb.getMessageService().getMessageText( UifConstants.MessageKeys.OPTION_ALL); MultiValueControl multiValueControl = (MultiValueControl) getControl(); if (multiValueControl.getOptions() != null) { multiValueControl.getOptions().add(0, new ConcreteKeyValue("", allOptionText)); } if (multiValueControl.getRichOptions() != null) { Message message = ComponentFactory.getMessage(); message.setMessageText(allOptionText); message.setRenderWrapperTag(false); multiValueControl.getRichOptions().add(0, new KeyMessage("", allOptionText, message)); } } } /** * Invoked during the finalize phase to capture state of the component needs to support post operations. */ @Override protected void addComponentPostMetadata() { super.addComponentPostMetadata(); Map<String, Map<String, Object>> lookupCriteriaFields = ViewLifecycle.getViewPostMetadata().getLookupCriteria(); Map<String, Object> criteriaAttributes = new HashMap<String, Object>(); criteriaAttributes.put(UifConstants.LookupCriteriaPostMetadata.COMPONENT_ID, this.getId()); if (this.isDisableWildcardsAndOperators()) { criteriaAttributes.put(UifConstants.LookupCriteriaPostMetadata.DISABLE_WILDCARDS_AND_OPERATORS, true); } if (this.getRequired()) { criteriaAttributes.put(UifConstants.LookupCriteriaPostMetadata.REQUIRED, true); } if (this.hasSecureValue()) { criteriaAttributes.put(UifConstants.LookupCriteriaPostMetadata.SECURE_VALUE, true); } ValidCharactersConstraint validCharactersConstraint = this.getValidCharactersConstraint(); if (validCharactersConstraint != null) { criteriaAttributes.put(UifConstants.LookupCriteriaPostMetadata.VALID_CHARACTERS_CONSTRAINT, validCharactersConstraint); } lookupCriteriaFields.put(this.getPropertyName(), criteriaAttributes); addHiddenComponentPostMetadata(lookupCriteriaFields); } /** * Add hidden search criteria components. * * @param lookupCriteriaFields */ protected void addHiddenComponentPostMetadata(Map<String, Map<String, Object>> lookupCriteriaFields) { for (String hiddenPropertyName: this.getAdditionalHiddenPropertyNames()) { hiddenPropertyName = StringUtils.substringBetween(hiddenPropertyName, UifPropertyPaths.LOOKUP_CRITERIA + "[", "]"); // Prevent overwriting of visible components. Note, hidden components are allowed to be overwritten. if (!lookupCriteriaFields.containsKey(hiddenPropertyName)) { Map<String, Object> criteriaAttributes = new HashMap<String, Object>(); criteriaAttributes.put(UifConstants.LookupCriteriaPostMetadata.HIDDEN, true); lookupCriteriaFields.put(hiddenPropertyName, criteriaAttributes); } } } /** * Override of InputField copy to setup properties necessary to make the field usable for inputting * search criteria. * * <p>Note super is not being called because we don't want to add restirctions that can cause problems * with the use of wildcard</p> * * {@inheritDoc} */ @Override public void copyFromAttributeDefinition(AttributeDefinition attributeDefinition) { // label if (StringUtils.isEmpty(getLabel())) { setLabel(attributeDefinition.getLabel()); } // short label if (StringUtils.isEmpty(getShortLabel())) { setShortLabel(attributeDefinition.getShortLabel()); } // security if ((attributeDefinition.getAttributeSecurity() != null) && ((getDataFieldSecurity() == null) || ( getDataFieldSecurity().getAttributeSecurity() == null))) { initializeComponentSecurity(); getDataFieldSecurity().setAttributeSecurity(attributeDefinition.getAttributeSecurity()); } // options if (getOptionsFinder() == null) { setOptionsFinder(attributeDefinition.getOptionsFinder()); } // use control from dictionary if not specified and convert for searching if (getControl() == null) { Control control = convertControlToLookupControl(attributeDefinition); setControl(control); } // overwrite maxLength to allow for wildcards and ranges; set a minimum max length unless it is greater than 100 setMaxLength(100); if ( attributeDefinition.getMaxLength()!=null && (attributeDefinition.getMaxLength() > 100)) { setMaxLength(attributeDefinition.getMaxLength()); } // set default value for active field to true if (getDefaultValue() == null || (getDefaultValue() instanceof String && StringUtils.isEmpty((String)getDefaultValue()))) { if ((StringUtils.equals(getPropertyName(), KRADPropertyConstants.ACTIVE))) { setDefaultValue(KRADConstants.YES_INDICATOR_VALUE); } } } /** * If control definition is defined on the given attribute definition, converts to an appropriate control for * searching (if necessary) and returns a copy for setting on the field. * * @param attributeDefinition attribute definition instance to retrieve control from * @return Control instance or null if not found */ protected static Control convertControlToLookupControl(AttributeDefinition attributeDefinition) { if (attributeDefinition.getControlField() == null) { return null; } Control newControl = null; // convert checkbox to radio with yes/no/both options if (CheckboxControl.class.isAssignableFrom(attributeDefinition.getControlField().getClass())) { newControl = (RadioGroupControl) ComponentFactory.getNewComponentInstance( ComponentFactory.CHECKBOX_CONVERTED_RADIO_CONTROL); } // text areas get converted to simple text inputs else if (TextAreaControl.class.isAssignableFrom(attributeDefinition.getControlField().getClass())) { newControl = ComponentFactory.getTextControl(); } else { newControl = ComponentUtils.copy(attributeDefinition.getControlField(), ""); } return newControl; } /** * Invoked before search is carried out to perform any necessary filtering of the criteria. * * @param searchCriteria the search criteria to be filtered * @return map of filtered search criteria */ public Map<String, String> filterSearchCriteria(Map<String, String> searchCriteria) { return searchCriteria; } /** * Indicates whether wildcard and other search operators should be disabled (treated as literals) for * the input field. * * @return boolean true if wildcards and search operators should be disabled, false if enabled */ @BeanTagAttribute(name = "disableWildcardsAndOperators") public boolean isDisableWildcardsAndOperators() { return this.disableWildcardsAndOperators; } /** * @see LookupInputField#isDisableWildcardsAndOperators() */ public void setDisableWildcardsAndOperators(boolean disableWildcardsAndOperators) { this.disableWildcardsAndOperators = disableWildcardsAndOperators; } /** * Indicates whether the option for all values (blank key, 'All' label) should be added to the lookup * field, note this is only supported for {@link org.kuali.rice.krad.uif.control.MultiValueControl} instance. * * @return boolean true if all option should be added, false if not */ @BeanTagAttribute(name = "addControlSelectAllOption") public boolean isAddControlSelectAllOption() { return addControlSelectAllOption; } /** * @see LookupInputField#isAddControlSelectAllOption() */ public void setAddControlSelectAllOption(boolean addControlSelectAllOption) { this.addControlSelectAllOption = addControlSelectAllOption; } /** * Indicates a field group should be created containing a from and to input field for date search * ranges. * * <p> * When this is set to true, the input field will be replaced by a field group that is created by * copying the prototype {@link org.kuali.rice.krad.lookup.LookupView#getRangeFieldGroupPrototype()}. Within the * field group, an lookup input field will be created for the from field, and this input will be used * as the to date field. Between the two fields a message will be rendered that can be specified using * {@link LookupView#getRangedToMessage()} * </p> * * @return boolean true if ranged field group should be created, false if not */ public boolean isRanged() { return ranged; } /** * @see LookupInputField#isRanged() */ public void setRanged(boolean ranged) { this.ranged = ranged; } }
package es.geeksusma.warehouse.api.dto; import javax.validation.constraints.NotBlank; public class NewItemRequest { @NotBlank(message = "Serial number is mandatory") private String serialNumber; @NotBlank(message = "Name is mandatory") private String name; private String description; private Integer stock; public NewItemRequest() { } public NewItemRequest(String serialNumber, String name, String description, Integer stock) { this.serialNumber = serialNumber; this.name = name; this.description = description; this.stock = stock; } public String getSerialNumber() { return serialNumber; } public String getName() { return name; } public String getDescription() { return description; } public Integer getStock() { return stock; } }
package org.jmusixmatch; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.Map; /** * Helper Utility Class * * @author Sachin Handiekar * @version 1.0 */ public final class Helper { /** * Private constructor to prevent instantiation. */ private Helper() { // do nothing } /** * This method is used to get a parameter string from the Map. * * @param params * key-value parameters * @return A String containing the url parameter. * @throws MusixMatchException */ public static String getURLString(String methodName, Map<String, Object> params) throws MusixMatchException { String paramString = new String(); paramString += methodName + "?"; for (Map.Entry<String, Object> entry : params.entrySet()) { try { paramString += entry.getKey() + "=" + URLEncoder.encode(entry.getValue().toString(), "UTF-8"); } catch (UnsupportedEncodingException e) { throw new MusixMatchException("Problem encoding " + entry.getValue(), e); } paramString += "&"; } paramString = paramString.substring(0, paramString.length() - 1); return paramString; } }
/* * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ // Generated by the protocol buffer compiler. DO NOT EDIT! // source: google/cloud/datacatalog/v1/table_spec.proto package com.google.cloud.datacatalog.v1; /** * * * <pre> * Describes a BigQuery table. * </pre> * * Protobuf type {@code google.cloud.datacatalog.v1.BigQueryTableSpec} */ public final class BigQueryTableSpec extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:google.cloud.datacatalog.v1.BigQueryTableSpec) BigQueryTableSpecOrBuilder { private static final long serialVersionUID = 0L; // Use BigQueryTableSpec.newBuilder() to construct. private BigQueryTableSpec(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) { super(builder); } private BigQueryTableSpec() { tableSourceType_ = 0; } @java.lang.Override @SuppressWarnings({"unused"}) protected java.lang.Object newInstance(UnusedPrivateParameter unused) { return new BigQueryTableSpec(); } @java.lang.Override public final com.google.protobuf.UnknownFieldSet getUnknownFields() { return this.unknownFields; } private BigQueryTableSpec( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); if (extensionRegistry == null) { throw new java.lang.NullPointerException(); } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { boolean done = false; while (!done) { int tag = input.readTag(); switch (tag) { case 0: done = true; break; case 8: { int rawValue = input.readEnum(); tableSourceType_ = rawValue; break; } case 18: { com.google.cloud.datacatalog.v1.ViewSpec.Builder subBuilder = null; if (typeSpecCase_ == 2) { subBuilder = ((com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_).toBuilder(); } typeSpec_ = input.readMessage( com.google.cloud.datacatalog.v1.ViewSpec.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_); typeSpec_ = subBuilder.buildPartial(); } typeSpecCase_ = 2; break; } case 26: { com.google.cloud.datacatalog.v1.TableSpec.Builder subBuilder = null; if (typeSpecCase_ == 3) { subBuilder = ((com.google.cloud.datacatalog.v1.TableSpec) typeSpec_).toBuilder(); } typeSpec_ = input.readMessage( com.google.cloud.datacatalog.v1.TableSpec.parser(), extensionRegistry); if (subBuilder != null) { subBuilder.mergeFrom((com.google.cloud.datacatalog.v1.TableSpec) typeSpec_); typeSpec_ = subBuilder.buildPartial(); } typeSpecCase_ = 3; break; } default: { if (!parseUnknownField(input, unknownFields, extensionRegistry, tag)) { done = true; } break; } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { throw e.setUnfinishedMessage(this); } catch (java.io.IOException e) { throw new com.google.protobuf.InvalidProtocolBufferException(e).setUnfinishedMessage(this); } finally { this.unknownFields = unknownFields.build(); makeExtensionsImmutable(); } } public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.datacatalog.v1.TableSpecOuterClass .internal_static_google_cloud_datacatalog_v1_BigQueryTableSpec_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.datacatalog.v1.TableSpecOuterClass .internal_static_google_cloud_datacatalog_v1_BigQueryTableSpec_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.datacatalog.v1.BigQueryTableSpec.class, com.google.cloud.datacatalog.v1.BigQueryTableSpec.Builder.class); } private int typeSpecCase_ = 0; private java.lang.Object typeSpec_; public enum TypeSpecCase implements com.google.protobuf.Internal.EnumLite, com.google.protobuf.AbstractMessage.InternalOneOfEnum { VIEW_SPEC(2), TABLE_SPEC(3), TYPESPEC_NOT_SET(0); private final int value; private TypeSpecCase(int value) { this.value = value; } /** * @param value The number of the enum to look for. * @return The enum associated with the given number. * @deprecated Use {@link #forNumber(int)} instead. */ @java.lang.Deprecated public static TypeSpecCase valueOf(int value) { return forNumber(value); } public static TypeSpecCase forNumber(int value) { switch (value) { case 2: return VIEW_SPEC; case 3: return TABLE_SPEC; case 0: return TYPESPEC_NOT_SET; default: return null; } } public int getNumber() { return this.value; } }; public TypeSpecCase getTypeSpecCase() { return TypeSpecCase.forNumber(typeSpecCase_); } public static final int TABLE_SOURCE_TYPE_FIELD_NUMBER = 1; private int tableSourceType_; /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @return The enum numeric value on the wire for tableSourceType. */ public int getTableSourceTypeValue() { return tableSourceType_; } /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @return The tableSourceType. */ public com.google.cloud.datacatalog.v1.TableSourceType getTableSourceType() { @SuppressWarnings("deprecation") com.google.cloud.datacatalog.v1.TableSourceType result = com.google.cloud.datacatalog.v1.TableSourceType.valueOf(tableSourceType_); return result == null ? com.google.cloud.datacatalog.v1.TableSourceType.UNRECOGNIZED : result; } public static final int VIEW_SPEC_FIELD_NUMBER = 2; /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> * * @return Whether the viewSpec field is set. */ public boolean hasViewSpec() { return typeSpecCase_ == 2; } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> * * @return The viewSpec. */ public com.google.cloud.datacatalog.v1.ViewSpec getViewSpec() { if (typeSpecCase_ == 2) { return (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance(); } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public com.google.cloud.datacatalog.v1.ViewSpecOrBuilder getViewSpecOrBuilder() { if (typeSpecCase_ == 2) { return (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance(); } public static final int TABLE_SPEC_FIELD_NUMBER = 3; /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> * * @return Whether the tableSpec field is set. */ public boolean hasTableSpec() { return typeSpecCase_ == 3; } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> * * @return The tableSpec. */ public com.google.cloud.datacatalog.v1.TableSpec getTableSpec() { if (typeSpecCase_ == 3) { return (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance(); } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public com.google.cloud.datacatalog.v1.TableSpecOrBuilder getTableSpecOrBuilder() { if (typeSpecCase_ == 3) { return (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance(); } private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; if (isInitialized == 0) return false; memoizedIsInitialized = 1; return true; } @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (tableSourceType_ != com.google.cloud.datacatalog.v1.TableSourceType.TABLE_SOURCE_TYPE_UNSPECIFIED .getNumber()) { output.writeEnum(1, tableSourceType_); } if (typeSpecCase_ == 2) { output.writeMessage(2, (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_); } if (typeSpecCase_ == 3) { output.writeMessage(3, (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_); } unknownFields.writeTo(output); } @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; size = 0; if (tableSourceType_ != com.google.cloud.datacatalog.v1.TableSourceType.TABLE_SOURCE_TYPE_UNSPECIFIED .getNumber()) { size += com.google.protobuf.CodedOutputStream.computeEnumSize(1, tableSourceType_); } if (typeSpecCase_ == 2) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 2, (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_); } if (typeSpecCase_ == 3) { size += com.google.protobuf.CodedOutputStream.computeMessageSize( 3, (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_); } size += unknownFields.getSerializedSize(); memoizedSize = size; return size; } @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { return true; } if (!(obj instanceof com.google.cloud.datacatalog.v1.BigQueryTableSpec)) { return super.equals(obj); } com.google.cloud.datacatalog.v1.BigQueryTableSpec other = (com.google.cloud.datacatalog.v1.BigQueryTableSpec) obj; if (tableSourceType_ != other.tableSourceType_) return false; if (!getTypeSpecCase().equals(other.getTypeSpecCase())) return false; switch (typeSpecCase_) { case 2: if (!getViewSpec().equals(other.getViewSpec())) return false; break; case 3: if (!getTableSpec().equals(other.getTableSpec())) return false; break; case 0: default: } if (!unknownFields.equals(other.unknownFields)) return false; return true; } @java.lang.Override public int hashCode() { if (memoizedHashCode != 0) { return memoizedHashCode; } int hash = 41; hash = (19 * hash) + getDescriptor().hashCode(); hash = (37 * hash) + TABLE_SOURCE_TYPE_FIELD_NUMBER; hash = (53 * hash) + tableSourceType_; switch (typeSpecCase_) { case 2: hash = (37 * hash) + VIEW_SPEC_FIELD_NUMBER; hash = (53 * hash) + getViewSpec().hashCode(); break; case 3: hash = (37 * hash) + TABLE_SPEC_FIELD_NUMBER; hash = (53 * hash) + getTableSpec().hashCode(); break; case 0: default: } hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( java.nio.ByteBuffer data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( com.google.protobuf.ByteString data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom(byte[] data) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return PARSER.parseFrom(data, extensionRegistry); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseDelimitedFrom( java.io.InputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseDelimitedFrom( java.io.InputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException( PARSER, input, extensionRegistry); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( com.google.protobuf.CodedInputStream input) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec parseFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { return com.google.protobuf.GeneratedMessageV3.parseWithIOException( PARSER, input, extensionRegistry); } @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); } public static Builder newBuilder(com.google.cloud.datacatalog.v1.BigQueryTableSpec prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); } @java.lang.Override protected Builder newBuilderForType(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { Builder builder = new Builder(parent); return builder; } /** * * * <pre> * Describes a BigQuery table. * </pre> * * Protobuf type {@code google.cloud.datacatalog.v1.BigQueryTableSpec} */ public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder> implements // @@protoc_insertion_point(builder_implements:google.cloud.datacatalog.v1.BigQueryTableSpec) com.google.cloud.datacatalog.v1.BigQueryTableSpecOrBuilder { public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() { return com.google.cloud.datacatalog.v1.TableSpecOuterClass .internal_static_google_cloud_datacatalog_v1_BigQueryTableSpec_descriptor; } @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return com.google.cloud.datacatalog.v1.TableSpecOuterClass .internal_static_google_cloud_datacatalog_v1_BigQueryTableSpec_fieldAccessorTable .ensureFieldAccessorsInitialized( com.google.cloud.datacatalog.v1.BigQueryTableSpec.class, com.google.cloud.datacatalog.v1.BigQueryTableSpec.Builder.class); } // Construct using com.google.cloud.datacatalog.v1.BigQueryTableSpec.newBuilder() private Builder() { maybeForceBuilderInitialization(); } private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { super(parent); maybeForceBuilderInitialization(); } private void maybeForceBuilderInitialization() { if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {} } @java.lang.Override public Builder clear() { super.clear(); tableSourceType_ = 0; typeSpecCase_ = 0; typeSpec_ = null; return this; } @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return com.google.cloud.datacatalog.v1.TableSpecOuterClass .internal_static_google_cloud_datacatalog_v1_BigQueryTableSpec_descriptor; } @java.lang.Override public com.google.cloud.datacatalog.v1.BigQueryTableSpec getDefaultInstanceForType() { return com.google.cloud.datacatalog.v1.BigQueryTableSpec.getDefaultInstance(); } @java.lang.Override public com.google.cloud.datacatalog.v1.BigQueryTableSpec build() { com.google.cloud.datacatalog.v1.BigQueryTableSpec result = buildPartial(); if (!result.isInitialized()) { throw newUninitializedMessageException(result); } return result; } @java.lang.Override public com.google.cloud.datacatalog.v1.BigQueryTableSpec buildPartial() { com.google.cloud.datacatalog.v1.BigQueryTableSpec result = new com.google.cloud.datacatalog.v1.BigQueryTableSpec(this); result.tableSourceType_ = tableSourceType_; if (typeSpecCase_ == 2) { if (viewSpecBuilder_ == null) { result.typeSpec_ = typeSpec_; } else { result.typeSpec_ = viewSpecBuilder_.build(); } } if (typeSpecCase_ == 3) { if (tableSpecBuilder_ == null) { result.typeSpec_ = typeSpec_; } else { result.typeSpec_ = tableSpecBuilder_.build(); } } result.typeSpecCase_ = typeSpecCase_; onBuilt(); return result; } @java.lang.Override public Builder clone() { return super.clone(); } @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.setField(field, value); } @java.lang.Override public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) { return super.clearField(field); } @java.lang.Override public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) { return super.clearOneof(oneof); } @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) { return super.setRepeatedField(field, index, value); } @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) { return super.addRepeatedField(field, value); } @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof com.google.cloud.datacatalog.v1.BigQueryTableSpec) { return mergeFrom((com.google.cloud.datacatalog.v1.BigQueryTableSpec) other); } else { super.mergeFrom(other); return this; } } public Builder mergeFrom(com.google.cloud.datacatalog.v1.BigQueryTableSpec other) { if (other == com.google.cloud.datacatalog.v1.BigQueryTableSpec.getDefaultInstance()) return this; if (other.tableSourceType_ != 0) { setTableSourceTypeValue(other.getTableSourceTypeValue()); } switch (other.getTypeSpecCase()) { case VIEW_SPEC: { mergeViewSpec(other.getViewSpec()); break; } case TABLE_SPEC: { mergeTableSpec(other.getTableSpec()); break; } case TYPESPEC_NOT_SET: { break; } } this.mergeUnknownFields(other.unknownFields); onChanged(); return this; } @java.lang.Override public final boolean isInitialized() { return true; } @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws java.io.IOException { com.google.cloud.datacatalog.v1.BigQueryTableSpec parsedMessage = null; try { parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); } catch (com.google.protobuf.InvalidProtocolBufferException e) { parsedMessage = (com.google.cloud.datacatalog.v1.BigQueryTableSpec) e.getUnfinishedMessage(); throw e.unwrapIOException(); } finally { if (parsedMessage != null) { mergeFrom(parsedMessage); } } return this; } private int typeSpecCase_ = 0; private java.lang.Object typeSpec_; public TypeSpecCase getTypeSpecCase() { return TypeSpecCase.forNumber(typeSpecCase_); } public Builder clearTypeSpec() { typeSpecCase_ = 0; typeSpec_ = null; onChanged(); return this; } private int tableSourceType_ = 0; /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @return The enum numeric value on the wire for tableSourceType. */ public int getTableSourceTypeValue() { return tableSourceType_; } /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @param value The enum numeric value on the wire for tableSourceType to set. * @return This builder for chaining. */ public Builder setTableSourceTypeValue(int value) { tableSourceType_ = value; onChanged(); return this; } /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @return The tableSourceType. */ public com.google.cloud.datacatalog.v1.TableSourceType getTableSourceType() { @SuppressWarnings("deprecation") com.google.cloud.datacatalog.v1.TableSourceType result = com.google.cloud.datacatalog.v1.TableSourceType.valueOf(tableSourceType_); return result == null ? com.google.cloud.datacatalog.v1.TableSourceType.UNRECOGNIZED : result; } /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @param value The tableSourceType to set. * @return This builder for chaining. */ public Builder setTableSourceType(com.google.cloud.datacatalog.v1.TableSourceType value) { if (value == null) { throw new NullPointerException(); } tableSourceType_ = value.getNumber(); onChanged(); return this; } /** * * * <pre> * Output only. The table source type. * </pre> * * <code> * .google.cloud.datacatalog.v1.TableSourceType table_source_type = 1 [(.google.api.field_behavior) = OUTPUT_ONLY]; * </code> * * @return This builder for chaining. */ public Builder clearTableSourceType() { tableSourceType_ = 0; onChanged(); return this; } private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.datacatalog.v1.ViewSpec, com.google.cloud.datacatalog.v1.ViewSpec.Builder, com.google.cloud.datacatalog.v1.ViewSpecOrBuilder> viewSpecBuilder_; /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> * * @return Whether the viewSpec field is set. */ public boolean hasViewSpec() { return typeSpecCase_ == 2; } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> * * @return The viewSpec. */ public com.google.cloud.datacatalog.v1.ViewSpec getViewSpec() { if (viewSpecBuilder_ == null) { if (typeSpecCase_ == 2) { return (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance(); } else { if (typeSpecCase_ == 2) { return viewSpecBuilder_.getMessage(); } return com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance(); } } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public Builder setViewSpec(com.google.cloud.datacatalog.v1.ViewSpec value) { if (viewSpecBuilder_ == null) { if (value == null) { throw new NullPointerException(); } typeSpec_ = value; onChanged(); } else { viewSpecBuilder_.setMessage(value); } typeSpecCase_ = 2; return this; } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public Builder setViewSpec(com.google.cloud.datacatalog.v1.ViewSpec.Builder builderForValue) { if (viewSpecBuilder_ == null) { typeSpec_ = builderForValue.build(); onChanged(); } else { viewSpecBuilder_.setMessage(builderForValue.build()); } typeSpecCase_ = 2; return this; } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public Builder mergeViewSpec(com.google.cloud.datacatalog.v1.ViewSpec value) { if (viewSpecBuilder_ == null) { if (typeSpecCase_ == 2 && typeSpec_ != com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance()) { typeSpec_ = com.google.cloud.datacatalog.v1.ViewSpec.newBuilder( (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_) .mergeFrom(value) .buildPartial(); } else { typeSpec_ = value; } onChanged(); } else { if (typeSpecCase_ == 2) { viewSpecBuilder_.mergeFrom(value); } viewSpecBuilder_.setMessage(value); } typeSpecCase_ = 2; return this; } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public Builder clearViewSpec() { if (viewSpecBuilder_ == null) { if (typeSpecCase_ == 2) { typeSpecCase_ = 0; typeSpec_ = null; onChanged(); } } else { if (typeSpecCase_ == 2) { typeSpecCase_ = 0; typeSpec_ = null; } viewSpecBuilder_.clear(); } return this; } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public com.google.cloud.datacatalog.v1.ViewSpec.Builder getViewSpecBuilder() { return getViewSpecFieldBuilder().getBuilder(); } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ public com.google.cloud.datacatalog.v1.ViewSpecOrBuilder getViewSpecOrBuilder() { if ((typeSpecCase_ == 2) && (viewSpecBuilder_ != null)) { return viewSpecBuilder_.getMessageOrBuilder(); } else { if (typeSpecCase_ == 2) { return (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance(); } } /** * * * <pre> * Table view specification. This field should only be populated if * `table_source_type` is `BIGQUERY_VIEW`. * </pre> * * <code>.google.cloud.datacatalog.v1.ViewSpec view_spec = 2;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.datacatalog.v1.ViewSpec, com.google.cloud.datacatalog.v1.ViewSpec.Builder, com.google.cloud.datacatalog.v1.ViewSpecOrBuilder> getViewSpecFieldBuilder() { if (viewSpecBuilder_ == null) { if (!(typeSpecCase_ == 2)) { typeSpec_ = com.google.cloud.datacatalog.v1.ViewSpec.getDefaultInstance(); } viewSpecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.datacatalog.v1.ViewSpec, com.google.cloud.datacatalog.v1.ViewSpec.Builder, com.google.cloud.datacatalog.v1.ViewSpecOrBuilder>( (com.google.cloud.datacatalog.v1.ViewSpec) typeSpec_, getParentForChildren(), isClean()); typeSpec_ = null; } typeSpecCase_ = 2; onChanged(); ; return viewSpecBuilder_; } private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.datacatalog.v1.TableSpec, com.google.cloud.datacatalog.v1.TableSpec.Builder, com.google.cloud.datacatalog.v1.TableSpecOrBuilder> tableSpecBuilder_; /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> * * @return Whether the tableSpec field is set. */ public boolean hasTableSpec() { return typeSpecCase_ == 3; } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> * * @return The tableSpec. */ public com.google.cloud.datacatalog.v1.TableSpec getTableSpec() { if (tableSpecBuilder_ == null) { if (typeSpecCase_ == 3) { return (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance(); } else { if (typeSpecCase_ == 3) { return tableSpecBuilder_.getMessage(); } return com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance(); } } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public Builder setTableSpec(com.google.cloud.datacatalog.v1.TableSpec value) { if (tableSpecBuilder_ == null) { if (value == null) { throw new NullPointerException(); } typeSpec_ = value; onChanged(); } else { tableSpecBuilder_.setMessage(value); } typeSpecCase_ = 3; return this; } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public Builder setTableSpec(com.google.cloud.datacatalog.v1.TableSpec.Builder builderForValue) { if (tableSpecBuilder_ == null) { typeSpec_ = builderForValue.build(); onChanged(); } else { tableSpecBuilder_.setMessage(builderForValue.build()); } typeSpecCase_ = 3; return this; } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public Builder mergeTableSpec(com.google.cloud.datacatalog.v1.TableSpec value) { if (tableSpecBuilder_ == null) { if (typeSpecCase_ == 3 && typeSpec_ != com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance()) { typeSpec_ = com.google.cloud.datacatalog.v1.TableSpec.newBuilder( (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_) .mergeFrom(value) .buildPartial(); } else { typeSpec_ = value; } onChanged(); } else { if (typeSpecCase_ == 3) { tableSpecBuilder_.mergeFrom(value); } tableSpecBuilder_.setMessage(value); } typeSpecCase_ = 3; return this; } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public Builder clearTableSpec() { if (tableSpecBuilder_ == null) { if (typeSpecCase_ == 3) { typeSpecCase_ = 0; typeSpec_ = null; onChanged(); } } else { if (typeSpecCase_ == 3) { typeSpecCase_ = 0; typeSpec_ = null; } tableSpecBuilder_.clear(); } return this; } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public com.google.cloud.datacatalog.v1.TableSpec.Builder getTableSpecBuilder() { return getTableSpecFieldBuilder().getBuilder(); } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ public com.google.cloud.datacatalog.v1.TableSpecOrBuilder getTableSpecOrBuilder() { if ((typeSpecCase_ == 3) && (tableSpecBuilder_ != null)) { return tableSpecBuilder_.getMessageOrBuilder(); } else { if (typeSpecCase_ == 3) { return (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_; } return com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance(); } } /** * * * <pre> * Spec of a BigQuery table. This field should only be populated if * `table_source_type` is `BIGQUERY_TABLE`. * </pre> * * <code>.google.cloud.datacatalog.v1.TableSpec table_spec = 3;</code> */ private com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.datacatalog.v1.TableSpec, com.google.cloud.datacatalog.v1.TableSpec.Builder, com.google.cloud.datacatalog.v1.TableSpecOrBuilder> getTableSpecFieldBuilder() { if (tableSpecBuilder_ == null) { if (!(typeSpecCase_ == 3)) { typeSpec_ = com.google.cloud.datacatalog.v1.TableSpec.getDefaultInstance(); } tableSpecBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< com.google.cloud.datacatalog.v1.TableSpec, com.google.cloud.datacatalog.v1.TableSpec.Builder, com.google.cloud.datacatalog.v1.TableSpecOrBuilder>( (com.google.cloud.datacatalog.v1.TableSpec) typeSpec_, getParentForChildren(), isClean()); typeSpec_ = null; } typeSpecCase_ = 3; onChanged(); ; return tableSpecBuilder_; } @java.lang.Override public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); } // @@protoc_insertion_point(builder_scope:google.cloud.datacatalog.v1.BigQueryTableSpec) } // @@protoc_insertion_point(class_scope:google.cloud.datacatalog.v1.BigQueryTableSpec) private static final com.google.cloud.datacatalog.v1.BigQueryTableSpec DEFAULT_INSTANCE; static { DEFAULT_INSTANCE = new com.google.cloud.datacatalog.v1.BigQueryTableSpec(); } public static com.google.cloud.datacatalog.v1.BigQueryTableSpec getDefaultInstance() { return DEFAULT_INSTANCE; } private static final com.google.protobuf.Parser<BigQueryTableSpec> PARSER = new com.google.protobuf.AbstractParser<BigQueryTableSpec>() { @java.lang.Override public BigQueryTableSpec parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { return new BigQueryTableSpec(input, extensionRegistry); } }; public static com.google.protobuf.Parser<BigQueryTableSpec> parser() { return PARSER; } @java.lang.Override public com.google.protobuf.Parser<BigQueryTableSpec> getParserForType() { return PARSER; } @java.lang.Override public com.google.cloud.datacatalog.v1.BigQueryTableSpec getDefaultInstanceForType() { return DEFAULT_INSTANCE; } }
public class CosSim { /** * Calculates the cosine similarity of two vectors of any length * * @param v1 Vector 1 * @param v2 Vector 2 * @return a double representing the cosine similarity. */ public double CosSim(double[] v1, double[] v2) { double norm1 = 0; double norm2 = 0; double scalar = 0; for (int i = 0; i < v1.length; i++) { scalar += v1[i] * v2[i]; norm1 += v1[i] * v1[i]; norm2 += v2[i] * v2[i]; } norm1 = Math.sqrt(norm1); norm2 = Math.sqrt(norm2); if (v1[0] == -100 | v2[0] == -100) { return Double.NEGATIVE_INFINITY; } else if (norm1 * norm2 == 0) { return 0; } scalar = scalar / (norm1 * norm2); if (Math.abs(scalar - 1) < 0.001) return 1; else if (Math.abs(scalar) < 0.001) return 0; else return scalar; } }
/* * ProGuard -- shrinking, optimization, obfuscation, and preverification * of Java bytecode. * * Copyright (c) 2002-2016 Eric Lafortune @ GuardSquare * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation; either version 2 of the License, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program; if not, write to the Free Software Foundation, Inc., * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package proguard.classfile.visitor; import proguard.classfile.*; /** * This <code>MemberVisitor</code> delegates its visits to another given * <code>MemberVisitor</code>, but only when visiting members of library * classes. * * @author Eric Lafortune */ public class LibraryMemberFilter implements MemberVisitor { private final MemberVisitor memberVisitor; /** * Creates a new ProgramMemberFilter. * @param memberVisitor the <code>MemberVisitor</code> to which * visits will be delegated. */ public LibraryMemberFilter(MemberVisitor memberVisitor) { this.memberVisitor = memberVisitor; } // Implementations for MemberVisitor. public void visitProgramField(ProgramClass programClass, ProgramField programField) { // Don't delegate visits to program members. } public void visitProgramMethod(ProgramClass programClass, ProgramMethod programMethod) { // Don't delegate visits to program members. } public void visitLibraryField(LibraryClass libraryClass, LibraryField libraryField) { memberVisitor.visitLibraryField(libraryClass, libraryField); } public void visitLibraryMethod(LibraryClass libraryClass, LibraryMethod libraryMethod) { memberVisitor.visitLibraryMethod(libraryClass, libraryMethod); } }
package com.xiejr.actuator.enums; import com.baomidou.mybatisplus.generator.config.IDbQuery; import com.baomidou.mybatisplus.generator.config.querys.*; import java.util.Arrays; import java.util.List; /** * @description 数据库类型枚举 * @author: xiejiarong * @create: 2020/06/22 **/ public enum DbType { /** * mysql数据量 */ Mysql(Arrays.asList("com.mysql.jdbc.Driver"), new MySqlQuery(), "MySql"), /** * oracle数据库 */ Oracle(Arrays.asList("oracle.jdbc.OracleDriver"), new OracleQuery(), "Oracle"), /** * db2数据库 */ DB2(Arrays.asList("com.ibm.db2.jcc.DB2Driver"), new DB2Query(), "DB2"), /** * postgre数据库 */ PostgreSql(Arrays.asList("org.postgresql.Driver"), new PostgreSqlQuery(), "Postgre"), /** * MariaDB数据库 */ Mariadb(Arrays.asList("org.mariadb.jdbc.Driver"), new MariadbQuery(), "MariaDB"), /** * sqlserver数据库 */ SqlServer(Arrays.asList("com.microsoft.sqlserver.jdbc.SQLServerDriver"), new SqlServerQuery(), "SQLServer"); /** * 驱动列表 */ private final List<String> driverList; /** * 查询适配器 */ private final IDbQuery iDbQuery; /** * 描述 */ private final String desc; private DbType(List<String> driverList, IDbQuery iDbQuery, String desc) { this.driverList = driverList; this.iDbQuery = iDbQuery; this.desc = desc; } public List<String> getDriverList() { return driverList; } public IDbQuery getiDbQuery() { return iDbQuery; } public String getDesc() { return desc; } }
package com.eshikhon.project.covid19.model; import com.google.gson.annotations.SerializedName; public class LatestStatByCountry { @SerializedName("id") private String id; @SerializedName("country_name") private String countryName; @SerializedName("total_cases") private String totalCases; @SerializedName("new_cases") private String newCases; @SerializedName("active_cases") private String activeCases; @SerializedName("total_deaths") private String totalDeaths; @SerializedName("new_deaths") private String newDeaths; @SerializedName("total_recovered") private String totalRecovered; @SerializedName("serious_critical") private String seriousCritical; @SerializedName("region") private Object region; @SerializedName("total_cases_per1m") private String totalCasesPer1m; @SerializedName("record_date") private String recordDate; @SerializedName("deaths_per1m") private String deathsPer1m; @SerializedName("total_tests") private String totalTests; @SerializedName("total_tests_per1m") private String totalTestsPer1m; public String getId() { return id; } public void setId(String id) { this.id = id; } public String getCountryName() { return countryName; } public void setCountryName(String countryName) { this.countryName = countryName; } public String getTotalCases() { return totalCases; } public void setTotalCases(String totalCases) { this.totalCases = totalCases; } public String getNewCases() { return newCases; } public void setNewCases(String newCases) { this.newCases = newCases; } public String getActiveCases() { return activeCases; } public void setActiveCases(String activeCases) { this.activeCases = activeCases; } public String getTotalDeaths() { return totalDeaths; } public void setTotalDeaths(String totalDeaths) { this.totalDeaths = totalDeaths; } public String getNewDeaths() { return newDeaths; } public void setNewDeaths(String newDeaths) { this.newDeaths = newDeaths; } public String getTotalRecovered() { return totalRecovered; } public void setTotalRecovered(String totalRecovered) { this.totalRecovered = totalRecovered; } public String getSeriousCritical() { return seriousCritical; } public void setSeriousCritical(String seriousCritical) { this.seriousCritical = seriousCritical; } public Object getRegion() { return region; } public void setRegion(Object region) { this.region = region; } public String getTotalCasesPer1m() { return totalCasesPer1m; } public void setTotalCasesPer1m(String totalCasesPer1m) { this.totalCasesPer1m = totalCasesPer1m; } public String getRecordDate() { return recordDate; } public void setRecordDate(String recordDate) { this.recordDate = recordDate; } public String getDeathsPer1m() { return deathsPer1m; } public void setDeathsPer1m(String deathsPer1m) { this.deathsPer1m = deathsPer1m; } public String getTotalTests() { return totalTests; } public void setTotalTests(String totalTests) { this.totalTests = totalTests; } public String getTotalTestsPer1m() { return totalTestsPer1m; } public void setTotalTestsPer1m(String totalTestsPer1m) { this.totalTestsPer1m = totalTestsPer1m; } }
/* * (C) Copyright IBM Corp. 2019, 2021 * * SPDX-License-Identifier: Apache-2.0 */ package com.ibm.fhir.model.type; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Objects; import javax.annotation.Generated; import com.ibm.fhir.model.annotation.Binding; import com.ibm.fhir.model.annotation.Choice; import com.ibm.fhir.model.annotation.Summary; import com.ibm.fhir.model.type.code.BindingStrength; import com.ibm.fhir.model.util.ValidationSupport; import com.ibm.fhir.model.visitor.Visitor; /** * Indicates how the medication is/was taken or should be taken by the patient. */ @Generated("com.ibm.fhir.tools.CodeGenerator") public class Dosage extends BackboneElement { @Summary private final Integer sequence; @Summary private final String text; @Summary @Binding( bindingName = "AdditionalInstruction", strength = BindingStrength.Value.EXAMPLE, description = "A coded concept identifying additional instructions such as \"take with water\" or \"avoid operating heavy machinery\".", valueSet = "http://hl7.org/fhir/ValueSet/additional-instruction-codes" ) private final List<CodeableConcept> additionalInstruction; @Summary private final String patientInstruction; @Summary private final Timing timing; @Summary @Choice({ Boolean.class, CodeableConcept.class }) @Binding( bindingName = "MedicationAsNeededReason", strength = BindingStrength.Value.EXAMPLE, description = "A coded concept identifying the precondition that should be met or evaluated prior to consuming or administering a medication dose. For example \"pain\", \"30 minutes prior to sexual intercourse\", \"on flare-up\" etc.", valueSet = "http://hl7.org/fhir/ValueSet/medication-as-needed-reason" ) private final Element asNeeded; @Summary @Binding( bindingName = "MedicationAdministrationSite", strength = BindingStrength.Value.EXAMPLE, description = "A coded concept describing the site location the medicine enters into or onto the body.", valueSet = "http://hl7.org/fhir/ValueSet/approach-site-codes" ) private final CodeableConcept site; @Summary @Binding( bindingName = "RouteOfAdministration", strength = BindingStrength.Value.EXAMPLE, description = "A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.", valueSet = "http://hl7.org/fhir/ValueSet/route-codes" ) private final CodeableConcept route; @Summary @Binding( bindingName = "MedicationAdministrationMethod", strength = BindingStrength.Value.EXAMPLE, description = "A coded concept describing the technique by which the medicine is administered.", valueSet = "http://hl7.org/fhir/ValueSet/administration-method-codes" ) private final CodeableConcept method; @Summary private final List<DoseAndRate> doseAndRate; @Summary private final Ratio maxDosePerPeriod; @Summary private final SimpleQuantity maxDosePerAdministration; @Summary private final SimpleQuantity maxDosePerLifetime; private Dosage(Builder builder) { super(builder); sequence = builder.sequence; text = builder.text; additionalInstruction = Collections.unmodifiableList(builder.additionalInstruction); patientInstruction = builder.patientInstruction; timing = builder.timing; asNeeded = builder.asNeeded; site = builder.site; route = builder.route; method = builder.method; doseAndRate = Collections.unmodifiableList(builder.doseAndRate); maxDosePerPeriod = builder.maxDosePerPeriod; maxDosePerAdministration = builder.maxDosePerAdministration; maxDosePerLifetime = builder.maxDosePerLifetime; } /** * Indicates the order in which the dosage instructions should be applied or interpreted. * * @return * An immutable object of type {@link Integer} that may be null. */ public Integer getSequence() { return sequence; } /** * Free text dosage instructions e.g. SIG. * * @return * An immutable object of type {@link String} that may be null. */ public String getText() { return text; } /** * Supplemental instructions to the patient on how to take the medication (e.g. "with meals" or"take half to one hour * before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin * to direct sunlight or sunlamps"). * * @return * An unmodifiable list containing immutable objects of type {@link CodeableConcept} that may be empty. */ public List<CodeableConcept> getAdditionalInstruction() { return additionalInstruction; } /** * Instructions in terms that are understood by the patient or consumer. * * @return * An immutable object of type {@link String} that may be null. */ public String getPatientInstruction() { return patientInstruction; } /** * When medication should be administered. * * @return * An immutable object of type {@link Timing} that may be null. */ public Timing getTiming() { return timing; } /** * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it * indicates the precondition for taking the Medication (CodeableConcept). * * @return * An immutable object of type {@link Element} that may be null. */ public Element getAsNeeded() { return asNeeded; } /** * Body site to administer to. * * @return * An immutable object of type {@link CodeableConcept} that may be null. */ public CodeableConcept getSite() { return site; } /** * How drug should enter body. * * @return * An immutable object of type {@link CodeableConcept} that may be null. */ public CodeableConcept getRoute() { return route; } /** * Technique for administering medication. * * @return * An immutable object of type {@link CodeableConcept} that may be null. */ public CodeableConcept getMethod() { return method; } /** * The amount of medication administered. * * @return * An unmodifiable list containing immutable objects of type {@link DoseAndRate} that may be empty. */ public List<DoseAndRate> getDoseAndRate() { return doseAndRate; } /** * Upper limit on medication per unit of time. * * @return * An immutable object of type {@link Ratio} that may be null. */ public Ratio getMaxDosePerPeriod() { return maxDosePerPeriod; } /** * Upper limit on medication per administration. * * @return * An immutable object of type {@link SimpleQuantity} that may be null. */ public SimpleQuantity getMaxDosePerAdministration() { return maxDosePerAdministration; } /** * Upper limit on medication per lifetime of the patient. * * @return * An immutable object of type {@link SimpleQuantity} that may be null. */ public SimpleQuantity getMaxDosePerLifetime() { return maxDosePerLifetime; } @Override public boolean hasChildren() { return super.hasChildren() || (sequence != null) || (text != null) || !additionalInstruction.isEmpty() || (patientInstruction != null) || (timing != null) || (asNeeded != null) || (site != null) || (route != null) || (method != null) || !doseAndRate.isEmpty() || (maxDosePerPeriod != null) || (maxDosePerAdministration != null) || (maxDosePerLifetime != null); } @Override public void accept(java.lang.String elementName, int elementIndex, Visitor visitor) { if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children accept(id, "id", visitor); accept(extension, "extension", visitor, Extension.class); accept(modifierExtension, "modifierExtension", visitor, Extension.class); accept(sequence, "sequence", visitor); accept(text, "text", visitor); accept(additionalInstruction, "additionalInstruction", visitor, CodeableConcept.class); accept(patientInstruction, "patientInstruction", visitor); accept(timing, "timing", visitor); accept(asNeeded, "asNeeded", visitor); accept(site, "site", visitor); accept(route, "route", visitor); accept(method, "method", visitor); accept(doseAndRate, "doseAndRate", visitor, DoseAndRate.class); accept(maxDosePerPeriod, "maxDosePerPeriod", visitor); accept(maxDosePerAdministration, "maxDosePerAdministration", visitor); accept(maxDosePerLifetime, "maxDosePerLifetime", visitor); } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } Dosage other = (Dosage) obj; return Objects.equals(id, other.id) && Objects.equals(extension, other.extension) && Objects.equals(modifierExtension, other.modifierExtension) && Objects.equals(sequence, other.sequence) && Objects.equals(text, other.text) && Objects.equals(additionalInstruction, other.additionalInstruction) && Objects.equals(patientInstruction, other.patientInstruction) && Objects.equals(timing, other.timing) && Objects.equals(asNeeded, other.asNeeded) && Objects.equals(site, other.site) && Objects.equals(route, other.route) && Objects.equals(method, other.method) && Objects.equals(doseAndRate, other.doseAndRate) && Objects.equals(maxDosePerPeriod, other.maxDosePerPeriod) && Objects.equals(maxDosePerAdministration, other.maxDosePerAdministration) && Objects.equals(maxDosePerLifetime, other.maxDosePerLifetime); } @Override public int hashCode() { int result = hashCode; if (result == 0) { result = Objects.hash(id, extension, modifierExtension, sequence, text, additionalInstruction, patientInstruction, timing, asNeeded, site, route, method, doseAndRate, maxDosePerPeriod, maxDosePerAdministration, maxDosePerLifetime); hashCode = result; } return result; } @Override public Builder toBuilder() { return new Builder().from(this); } public static Builder builder() { return new Builder(); } public static class Builder extends BackboneElement.Builder { private Integer sequence; private String text; private List<CodeableConcept> additionalInstruction = new ArrayList<>(); private String patientInstruction; private Timing timing; private Element asNeeded; private CodeableConcept site; private CodeableConcept route; private CodeableConcept method; private List<DoseAndRate> doseAndRate = new ArrayList<>(); private Ratio maxDosePerPeriod; private SimpleQuantity maxDosePerAdministration; private SimpleQuantity maxDosePerLifetime; private Builder() { super(); } /** * Unique id for the element within a resource (for internal references). This may be any string value that does not * contain spaces. * * @param id * Unique id for inter-element referencing * * @return * A reference to this Builder instance */ @Override public Builder id(java.lang.String id) { return (Builder) super.id(id); } /** * May be used to represent additional information that is not part of the basic definition of the element. To make the * use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of * extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part * of the definition of the extension. * * <p>Adds new element(s) to the existing list * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Extension... extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element. To make the * use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of * extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part * of the definition of the extension. * * <p>Replaces the existing list with a new one containing elements from the Collection * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Collection<Extension> extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained and/or the understanding of the containing * element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe * and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any * implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the * extension. Applications processing a resource are required to check for modifier extensions. * * <p>Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot * change the meaning of modifierExtension itself). * * <p>Adds new element(s) to the existing list * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Extension... modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained and/or the understanding of the containing * element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe * and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any * implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the * extension. Applications processing a resource are required to check for modifier extensions. * * <p>Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot * change the meaning of modifierExtension itself). * * <p>Replaces the existing list with a new one containing elements from the Collection * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Collection<Extension> modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * Indicates the order in which the dosage instructions should be applied or interpreted. * * @param sequence * The order of the dosage instructions * * @return * A reference to this Builder instance */ public Builder sequence(Integer sequence) { this.sequence = sequence; return this; } /** * Free text dosage instructions e.g. SIG. * * @param text * Free text dosage instructions e.g. SIG * * @return * A reference to this Builder instance */ public Builder text(String text) { this.text = text; return this; } /** * Supplemental instructions to the patient on how to take the medication (e.g. "with meals" or"take half to one hour * before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin * to direct sunlight or sunlamps"). * * <p>Adds new element(s) to the existing list * * @param additionalInstruction * Supplemental instruction or warnings to the patient - e.g. "with meals", "may cause drowsiness" * * @return * A reference to this Builder instance */ public Builder additionalInstruction(CodeableConcept... additionalInstruction) { for (CodeableConcept value : additionalInstruction) { this.additionalInstruction.add(value); } return this; } /** * Supplemental instructions to the patient on how to take the medication (e.g. "with meals" or"take half to one hour * before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin * to direct sunlight or sunlamps"). * * <p>Replaces the existing list with a new one containing elements from the Collection * * @param additionalInstruction * Supplemental instruction or warnings to the patient - e.g. "with meals", "may cause drowsiness" * * @return * A reference to this Builder instance */ public Builder additionalInstruction(Collection<CodeableConcept> additionalInstruction) { this.additionalInstruction = new ArrayList<>(additionalInstruction); return this; } /** * Instructions in terms that are understood by the patient or consumer. * * @param patientInstruction * Patient or consumer oriented instructions * * @return * A reference to this Builder instance */ public Builder patientInstruction(String patientInstruction) { this.patientInstruction = patientInstruction; return this; } /** * When medication should be administered. * * @param timing * When medication should be administered * * @return * A reference to this Builder instance */ public Builder timing(Timing timing) { this.timing = timing; return this; } /** * Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it * indicates the precondition for taking the Medication (CodeableConcept). * * <p>This is a choice element with the following allowed types: * <ul> * <li>{@link Boolean}</li> * <li>{@link CodeableConcept}</li> * </ul> * * @param asNeeded * Take "as needed" (for x) * * @return * A reference to this Builder instance */ public Builder asNeeded(Element asNeeded) { this.asNeeded = asNeeded; return this; } /** * Body site to administer to. * * @param site * Body site to administer to * * @return * A reference to this Builder instance */ public Builder site(CodeableConcept site) { this.site = site; return this; } /** * How drug should enter body. * * @param route * How drug should enter body * * @return * A reference to this Builder instance */ public Builder route(CodeableConcept route) { this.route = route; return this; } /** * Technique for administering medication. * * @param method * Technique for administering medication * * @return * A reference to this Builder instance */ public Builder method(CodeableConcept method) { this.method = method; return this; } /** * The amount of medication administered. * * <p>Adds new element(s) to the existing list * * @param doseAndRate * Amount of medication administered * * @return * A reference to this Builder instance */ public Builder doseAndRate(DoseAndRate... doseAndRate) { for (DoseAndRate value : doseAndRate) { this.doseAndRate.add(value); } return this; } /** * The amount of medication administered. * * <p>Replaces the existing list with a new one containing elements from the Collection * * @param doseAndRate * Amount of medication administered * * @return * A reference to this Builder instance */ public Builder doseAndRate(Collection<DoseAndRate> doseAndRate) { this.doseAndRate = new ArrayList<>(doseAndRate); return this; } /** * Upper limit on medication per unit of time. * * @param maxDosePerPeriod * Upper limit on medication per unit of time * * @return * A reference to this Builder instance */ public Builder maxDosePerPeriod(Ratio maxDosePerPeriod) { this.maxDosePerPeriod = maxDosePerPeriod; return this; } /** * Upper limit on medication per administration. * * @param maxDosePerAdministration * Upper limit on medication per administration * * @return * A reference to this Builder instance */ public Builder maxDosePerAdministration(SimpleQuantity maxDosePerAdministration) { this.maxDosePerAdministration = maxDosePerAdministration; return this; } /** * Upper limit on medication per lifetime of the patient. * * @param maxDosePerLifetime * Upper limit on medication per lifetime of the patient * * @return * A reference to this Builder instance */ public Builder maxDosePerLifetime(SimpleQuantity maxDosePerLifetime) { this.maxDosePerLifetime = maxDosePerLifetime; return this; } /** * Build the {@link Dosage} * * @return * An immutable object of type {@link Dosage} * @throws IllegalStateException * if the current state cannot be built into a valid Dosage per the base specification */ @Override public Dosage build() { Dosage dosage = new Dosage(this); if (validating) { validate(dosage); } return dosage; } protected void validate(Dosage dosage) { super.validate(dosage); ValidationSupport.checkList(dosage.additionalInstruction, "additionalInstruction", CodeableConcept.class); ValidationSupport.choiceElement(dosage.asNeeded, "asNeeded", Boolean.class, CodeableConcept.class); ValidationSupport.checkList(dosage.doseAndRate, "doseAndRate", DoseAndRate.class); ValidationSupport.requireValueOrChildren(dosage); } protected Builder from(Dosage dosage) { super.from(dosage); sequence = dosage.sequence; text = dosage.text; additionalInstruction.addAll(dosage.additionalInstruction); patientInstruction = dosage.patientInstruction; timing = dosage.timing; asNeeded = dosage.asNeeded; site = dosage.site; route = dosage.route; method = dosage.method; doseAndRate.addAll(dosage.doseAndRate); maxDosePerPeriod = dosage.maxDosePerPeriod; maxDosePerAdministration = dosage.maxDosePerAdministration; maxDosePerLifetime = dosage.maxDosePerLifetime; return this; } } /** * The amount of medication administered. */ public static class DoseAndRate extends BackboneElement { @Summary @Binding( bindingName = "DoseAndRateType", strength = BindingStrength.Value.EXAMPLE, description = "The kind of dose or rate specified.", valueSet = "http://hl7.org/fhir/ValueSet/dose-rate-type" ) private final CodeableConcept type; @Summary @Choice({ Range.class, SimpleQuantity.class }) private final Element dose; @Summary @Choice({ Ratio.class, Range.class, SimpleQuantity.class }) private final Element rate; private DoseAndRate(Builder builder) { super(builder); type = builder.type; dose = builder.dose; rate = builder.rate; } /** * The kind of dose or rate specified, for example, ordered or calculated. * * @return * An immutable object of type {@link CodeableConcept} that may be null. */ public CodeableConcept getType() { return type; } /** * Amount of medication per dose. * * @return * An immutable object of type {@link Element} that may be null. */ public Element getDose() { return dose; } /** * Amount of medication per unit of time. * * @return * An immutable object of type {@link Element} that may be null. */ public Element getRate() { return rate; } @Override public boolean hasChildren() { return super.hasChildren() || (type != null) || (dose != null) || (rate != null); } @Override public void accept(java.lang.String elementName, int elementIndex, Visitor visitor) { if (visitor.preVisit(this)) { visitor.visitStart(elementName, elementIndex, this); if (visitor.visit(elementName, elementIndex, this)) { // visit children accept(id, "id", visitor); accept(extension, "extension", visitor, Extension.class); accept(modifierExtension, "modifierExtension", visitor, Extension.class); accept(type, "type", visitor); accept(dose, "dose", visitor); accept(rate, "rate", visitor); } visitor.visitEnd(elementName, elementIndex, this); visitor.postVisit(this); } } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } DoseAndRate other = (DoseAndRate) obj; return Objects.equals(id, other.id) && Objects.equals(extension, other.extension) && Objects.equals(modifierExtension, other.modifierExtension) && Objects.equals(type, other.type) && Objects.equals(dose, other.dose) && Objects.equals(rate, other.rate); } @Override public int hashCode() { int result = hashCode; if (result == 0) { result = Objects.hash(id, extension, modifierExtension, type, dose, rate); hashCode = result; } return result; } @Override public Builder toBuilder() { return new Builder().from(this); } public static Builder builder() { return new Builder(); } public static class Builder extends BackboneElement.Builder { private CodeableConcept type; private Element dose; private Element rate; private Builder() { super(); } /** * Unique id for the element within a resource (for internal references). This may be any string value that does not * contain spaces. * * @param id * Unique id for inter-element referencing * * @return * A reference to this Builder instance */ @Override public Builder id(java.lang.String id) { return (Builder) super.id(id); } /** * May be used to represent additional information that is not part of the basic definition of the element. To make the * use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of * extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part * of the definition of the extension. * * <p>Adds new element(s) to the existing list * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Extension... extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element. To make the * use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of * extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part * of the definition of the extension. * * <p>Replaces the existing list with a new one containing elements from the Collection * * @param extension * Additional content defined by implementations * * @return * A reference to this Builder instance */ @Override public Builder extension(Collection<Extension> extension) { return (Builder) super.extension(extension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained and/or the understanding of the containing * element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe * and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any * implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the * extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions * SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of * modifierExtension itself). * * <p>Adds new element(s) to the existing list * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Extension... modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * May be used to represent additional information that is not part of the basic definition of the element and that * modifies the understanding of the element in which it is contained and/or the understanding of the containing * element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe * and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any * implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the * extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions * SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of * modifierExtension itself). * * <p>Replaces the existing list with a new one containing elements from the Collection * * @param modifierExtension * Extensions that cannot be ignored even if unrecognized * * @return * A reference to this Builder instance */ @Override public Builder modifierExtension(Collection<Extension> modifierExtension) { return (Builder) super.modifierExtension(modifierExtension); } /** * The kind of dose or rate specified, for example, ordered or calculated. * * @param type * The kind of dose or rate specified * * @return * A reference to this Builder instance */ public Builder type(CodeableConcept type) { this.type = type; return this; } /** * Amount of medication per dose. * * <p>This is a choice element with the following allowed types: * <ul> * <li>{@link Range}</li> * <li>{@link SimpleQuantity}</li> * </ul> * * @param dose * Amount of medication per dose * * @return * A reference to this Builder instance */ public Builder dose(Element dose) { this.dose = dose; return this; } /** * Amount of medication per unit of time. * * <p>This is a choice element with the following allowed types: * <ul> * <li>{@link Ratio}</li> * <li>{@link Range}</li> * <li>{@link SimpleQuantity}</li> * </ul> * * @param rate * Amount of medication per unit of time * * @return * A reference to this Builder instance */ public Builder rate(Element rate) { this.rate = rate; return this; } /** * Build the {@link DoseAndRate} * * @return * An immutable object of type {@link DoseAndRate} * @throws IllegalStateException * if the current state cannot be built into a valid DoseAndRate per the base specification */ @Override public DoseAndRate build() { DoseAndRate doseAndRate = new DoseAndRate(this); if (validating) { validate(doseAndRate); } return doseAndRate; } protected void validate(DoseAndRate doseAndRate) { super.validate(doseAndRate); ValidationSupport.choiceElement(doseAndRate.dose, "dose", Range.class, SimpleQuantity.class); ValidationSupport.choiceElement(doseAndRate.rate, "rate", Ratio.class, Range.class, SimpleQuantity.class); ValidationSupport.requireValueOrChildren(doseAndRate); } protected Builder from(DoseAndRate doseAndRate) { super.from(doseAndRate); type = doseAndRate.type; dose = doseAndRate.dose; rate = doseAndRate.rate; return this; } } } }
/* * Copyright 2006 Webmedia Group Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.araneaframework.framework.util; import java.io.Serializable; import java.util.Random; import org.araneaframework.framework.TransactionContext; /** * Helper class for determining if transaction id is consistent. Transaction id is considered consistent when it equals * {@link TransactionContext#OVERRIDE_KEY} or current transaction id. If current transaction id is not yet set, any * transaction id is considered consistent. * * @author "Toomas Römer" <toomas@webmedia.ee> */ public class TransactionHelper implements Serializable { private Long currentTransactionId; private Long nextTransactionId; private Random random = new Random(System.currentTimeMillis()); public TransactionHelper() { resetTransactionId(); } /** * Generates a new current transaction id. */ public void resetTransactionId() { this.currentTransactionId = this.nextTransactionId; this.nextTransactionId = this.random.nextLong(); } /** * Returns the current transaction id. */ public Object getCurrentTransactionId() { return currentTransactionId; } public Long getNextTransactionId() { return nextTransactionId; } /** * Returns true if current transaction ID is <code>null</code> or transactionId equals the current transaction ID or * transactionId has been overridden. */ public boolean isConsistent(Object transactionId) { if (currentTransactionId == null) return true; if (isOverride(transactionId)) return true; return currentTransactionId.toString().equals(transactionId); } /** * Returns true if current transaction id is null or transactionId does not equal the current transaction id. */ public boolean isOverride(Object transactionId) { return TransactionContext.OVERRIDE_KEY.equals(transactionId); } }
/* * Copyright The OpenTelemetry Authors * SPDX-License-Identifier: Apache-2.0 */ package io.opentelemetry.opencensusshim.metrics; import static io.opentelemetry.sdk.testing.assertj.MetricAssertions.assertThat; import io.opencensus.contrib.exemplar.util.ExemplarUtils; import io.opencensus.stats.Aggregation; import io.opencensus.stats.BucketBoundaries; import io.opencensus.stats.Measure; import io.opencensus.stats.MeasureMap; import io.opencensus.stats.Stats; import io.opencensus.stats.StatsRecorder; import io.opencensus.stats.View; import io.opencensus.trace.SpanContext; import io.opencensus.trace.SpanId; import io.opencensus.trace.TraceId; import io.opencensus.trace.TraceOptions; import io.opencensus.trace.Tracestate; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.sdk.metrics.internal.export.MetricProducer; import io.opentelemetry.sdk.resources.Resource; import java.time.Duration; import java.util.Arrays; import java.util.Collections; import java.util.Random; import org.awaitility.Awaitility; import org.junit.jupiter.api.Test; class OpenCensusMetricProducerTest { private final MetricProducer openCensusMetrics = OpenCensusMetricProducer.create(Resource.empty()); private static final Measure.MeasureLong LATENCY_MS = Measure.MeasureLong.create("task_latency", "The task latency in milliseconds", "ms"); // Latency in buckets: // [>=0ms, >=100ms, >=200ms, >=400ms, >=1s, >=2s, >=4s] private static final BucketBoundaries LATENCY_BOUNDARIES = BucketBoundaries.create(Arrays.asList(0d, 100d, 200d, 400d, 1000d, 2000d, 4000d)); private static final StatsRecorder STATS_RECORDER = Stats.getStatsRecorder(); // For Exemplar private static final Random RANDOM = new Random(1234); private static final TraceId TRACE_ID = TraceId.generateRandomId(RANDOM); private static final SpanId SPAN_ID = SpanId.generateRandomId(RANDOM); private static final SpanContext SPAN_CONTEXT = SpanContext.create(TRACE_ID, SPAN_ID, TraceOptions.DEFAULT, Tracestate.builder().build()); @Test void extractHistogram() throws InterruptedException { View view = View.create( View.Name.create("task_latency_distribution"), "The distribution of the task latencies.", LATENCY_MS, Aggregation.Distribution.create(LATENCY_BOUNDARIES), Collections.emptyList()); Stats.getViewManager().registerView(view); MeasureMap recorder = STATS_RECORDER.newMeasureMap(); ExemplarUtils.putSpanContextAttachments(recorder, SPAN_CONTEXT); recorder.put(LATENCY_MS, 50).record(); // Wait for measurement to hit the aggregator. Awaitility.await() .atMost(Duration.ofSeconds(10)) .untilAsserted( () -> assertThat(openCensusMetrics.collectAllMetrics()) .satisfiesExactly( metric -> assertThat(metric) .hasName("task_latency_distribution") .hasDescription("The distribution of the task latencies.") .hasUnit("ms") .hasDoubleHistogram() .isCumulative() .points() .satisfiesExactly( point -> assertThat(point) .hasSum(50) .hasCount(1) .hasBucketCounts(1, 0, 0, 0, 0, 0, 0) .hasBucketBoundaries( 100d, 200d, 400d, 1000d, 2000d, 4000d) .exemplars() .satisfiesExactly( exemplar -> assertThat(exemplar) .hasFilteredAttributes(Attributes.empty()) .hasValue(50) .hasTraceId(TRACE_ID.toLowerBase16()) .hasSpanId(SPAN_ID.toLowerBase16()))))); } }
package com.coderwjq.a03_androidaidldemo; import android.os.Parcel; import android.os.Parcelable; /** * Created by coderwjq on 2017/4/21. */ public class Book implements Parcelable { public static final Creator<Book> CREATOR = new Creator<Book>() { @Override public Book createFromParcel(Parcel in) { return new Book(in); } @Override public Book[] newArray(int size) { return new Book[size]; } }; private int price; private String name; public Book() { } protected Book(Parcel in) { price = in.readInt(); name = in.readString(); } public int getPrice() { return price; } public void setPrice(int price) { this.price = price; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public int describeContents() { return 0; } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeInt(price); dest.writeString(name); } public void readFromParcel(Parcel dest) { // 此处读值顺序应当和writeToParcel方法一致 price = dest.readInt(); name = dest.readString(); } @Override public String toString() { return "Book{" + "price=" + price + ", name='" + name + '\'' + '}'; } }
/** * iBizSys 5.0 机器人生产代码(不要直接修改当前代码) * http://www.ibizsys.net */ package com.sa.unip.app.srv.wf.ctrlmodel; import java.util.ArrayList; import java.util.List; import net.ibizsys.paas.util.StringHelper; import net.ibizsys.paas.web.AjaxActionResult; import net.ibizsys.paas.web.WebContext; import net.ibizsys.paas.util.GlobalContext; import net.ibizsys.paas.core.IDEDataSetCond; import net.ibizsys.paas.core.DEDataSetCond; import net.ibizsys.paas.core.DEDataSetFetchContext; import net.ibizsys.paas.db.DBFetchResult; import net.ibizsys.paas.web.WebContext; import net.ibizsys.paas.util.DataTypeHelper; import net.ibizsys.paas.data.IDataObject; import net.ibizsys.paas.datamodel.DataItemModel; import net.ibizsys.paas.datamodel.DataItemParamModel; import net.ibizsys.paas.entity.EntityFieldError; import net.ibizsys.paas.entity.EntityError; import net.ibizsys.paas.demodel.IDataEntityModel; import net.ibizsys.paas.demodel.DEModelGlobal; import net.ibizsys.paas.ctrlmodel.ListDataItemModel; import net.ibizsys.paas.datamodel.DataItemParamModel; /** * 实体[工作流工作列表]数据列表[db_myworklist_list]部件模型 */ public class WFWorkListMyWorkListListModel extends net.ibizsys.paas.ctrlmodel.ListModelBase { public WFWorkListMyWorkListListModel() { super(); this.setPageSize(1000); } private com.sa.unip.srv.subsys.demodel.WFWorkListDEModel wFWorkListDEModel; protected com.sa.unip.srv.subsys.demodel.WFWorkListDEModel getWFWorkListDEModel() { if(this.wFWorkListDEModel==null) { try { this.wFWorkListDEModel = (com.sa.unip.srv.subsys.demodel.WFWorkListDEModel)DEModelGlobal.getDEModel("com.sa.unip.srv.subsys.demodel.WFWorkListDEModel"); } catch(Exception ex) { } } return this.wFWorkListDEModel; } @Override public IDataEntityModel getDEModel() { return this.getWFWorkListDEModel(); } /** * 准备列表数据项模型 * @throws Exception */ protected void prepareListDataItemModels()throws Exception { super.prepareListDataItemModels(); // userdatainfo ListDataItemModel listDataItem0 = new ListDataItemModel(); listDataItem0.setName("userdatainfo"); listDataItem0.setDataType(25); listDataItem0.setFormat("%1$s"); if(true) { DataItemParamModel dataItemParam0 = new DataItemParamModel(); dataItemParam0.setName("userdatainfo"); dataItemParam0.setDataItem(listDataItem0); listDataItem0.addDataItemParam(dataItemParam0); } listDataItem0.init(this); this.registerListDataItem(listDataItem0); // userdata4 ListDataItemModel listDataItem1 = new ListDataItemModel(); listDataItem1.setName("userdata4"); listDataItem1.setDataType(25); listDataItem1.setFormat("%1$s"); if(true) { DataItemParamModel dataItemParam0 = new DataItemParamModel(); dataItemParam0.setName("userdata4"); dataItemParam0.setDataItem(listDataItem1); listDataItem1.addDataItemParam(dataItemParam0); } listDataItem1.init(this); this.registerListDataItem(listDataItem1); // wfinstancename ListDataItemModel listDataItem2 = new ListDataItemModel(); listDataItem2.setName("wfinstancename"); listDataItem2.setDataType(25); listDataItem2.setFormat("%1$s"); if(true) { DataItemParamModel dataItemParam0 = new DataItemParamModel(); dataItemParam0.setName("wfinstancename"); dataItemParam0.setDataItem(listDataItem2); listDataItem2.addDataItemParam(dataItemParam0); } listDataItem2.init(this); this.registerListDataItem(listDataItem2); // createdate ListDataItemModel listDataItem3 = new ListDataItemModel(); listDataItem3.setName("createdate"); listDataItem3.setDataType(5); listDataItem3.setFormat("%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS"); if(true) { DataItemParamModel dataItemParam0 = new DataItemParamModel(); dataItemParam0.setName("createdate"); dataItemParam0.setDataItem(listDataItem3); listDataItem3.addDataItemParam(dataItemParam0); } listDataItem3.init(this); this.registerListDataItem(listDataItem3); // wfstepname ListDataItemModel listDataItem4 = new ListDataItemModel(); listDataItem4.setName("wfstepname"); listDataItem4.setDataType(25); listDataItem4.setFormat("%1$s"); if(true) { DataItemParamModel dataItemParam0 = new DataItemParamModel(); dataItemParam0.setName("wfstepname"); dataItemParam0.setDataItem(listDataItem4); listDataItem4.addDataItemParam(dataItemParam0); } listDataItem4.init(this); this.registerListDataItem(listDataItem4); // userdata ListDataItemModel listDataItem5 = new ListDataItemModel(); listDataItem5.setName("userdata"); listDataItem5.setDataType(25); listDataItem5.setFormat("%1$s"); if(true) { DataItemParamModel dataItemParam0 = new DataItemParamModel(); dataItemParam0.setName("userdata"); dataItemParam0.setDataItem(listDataItem5); listDataItem5.addDataItemParam(dataItemParam0); } listDataItem5.init(this); this.registerListDataItem(listDataItem5); } }