repo_name stringlengths 5 108 | path stringlengths 6 333 | size stringlengths 1 6 | content stringlengths 4 977k | license stringclasses 15
values |
|---|---|---|---|---|
joansmith/sonarqube | sonar-batch/src/main/java/org/sonar/batch/issue/IssueCallback.java | 931 | /*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.batch.issue;
public interface IssueCallback {
void execute();
}
| lgpl-3.0 |
Jezza/ExperiJ | src/main/java/com/experij/repackage/org/objectweb/asm/util/TraceClassVisitor.java | 8043 | /***
* ASM: a very small and fast Java bytecode manipulation framework
* Copyright (c) 2000-2011 INRIA, France Telecom
* 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 copyright holders 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 OWNER 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.experij.repackage.org.objectweb.asm.util;
import java.io.PrintWriter;
import com.experij.repackage.org.objectweb.asm.Attribute;
import com.experij.repackage.org.objectweb.asm.Opcodes;
import com.experij.repackage.org.objectweb.asm.AnnotationVisitor;
import com.experij.repackage.org.objectweb.asm.FieldVisitor;
import com.experij.repackage.org.objectweb.asm.MethodVisitor;
import com.experij.repackage.org.objectweb.asm.TypePath;
import com.experij.repackage.org.objectweb.asm.ClassVisitor;
/**
* A {@link ClassVisitor} that prints the classes it visits with a
* {@link Printer}. This class visitor can be used in the middle of a class
* visitor chain to trace the class that is visited at a given point in this
* chain. This may be useful for debugging purposes.
* <p>
* The trace printed when visiting the <tt>Hello</tt> class is the following:
* <p>
* <blockquote>
*
* <pre>
* // class version 49.0 (49) // access flags 0x21 public class Hello {
*
* // compiled from: Hello.java
*
* // access flags 0x1 public <init> ()V ALOAD 0 INVOKESPECIAL
* java/lang/Object <init> ()V RETURN MAXSTACK = 1 MAXLOCALS = 1
*
* // access flags 0x9 public static main ([Ljava/lang/String;)V GETSTATIC
* java/lang/System out Ljava/io/PrintStream; LDC "hello"
* INVOKEVIRTUAL java/io/PrintStream println (Ljava/lang/String;)V RETURN
* MAXSTACK = 2 MAXLOCALS = 1 }
* </pre>
*
* </blockquote> where <tt>Hello</tt> is defined by:
* <p>
* <blockquote>
*
* <pre>
* public class Hello {
*
* public static void main(String[] args) {
* System.out.println("hello");
* }
* }
* </pre>
*
* </blockquote>
*
* @author Eric Bruneton
* @author Eugene Kuleshov
*/
public final class TraceClassVisitor extends ClassVisitor {
/**
* The print writer to be used to print the class. May be null.
*/
private final PrintWriter pw;
/**
* The object that actually converts visit events into text.
*/
public final Printer p;
/**
* Constructs a new {@link TraceClassVisitor}.
*
* @param pw
* the print writer to be used to print the class.
*/
public TraceClassVisitor(final PrintWriter pw) {
this(null, pw);
}
/**
* Constructs a new {@link TraceClassVisitor}.
*
* @param cv
* the {@link ClassVisitor} to which this visitor delegates
* calls. May be <tt>null</tt>.
* @param pw
* the print writer to be used to print the class.
*/
public TraceClassVisitor(final ClassVisitor cv, final PrintWriter pw) {
this(cv, new Textifier(), pw);
}
/**
* Constructs a new {@link TraceClassVisitor}.
*
* @param cv
* the {@link ClassVisitor} to which this visitor delegates
* calls. May be <tt>null</tt>.
* @param p
* the object that actually converts visit events into text.
* @param pw
* the print writer to be used to print the class. May be null if
* you simply want to use the result via
* {@link Printer#getText()}, instead of printing it.
*/
public TraceClassVisitor(final ClassVisitor cv, final Printer p,
final PrintWriter pw) {
super(Opcodes.ASM5, cv);
this.pw = pw;
this.p = p;
}
@Override
public void visit(final int version, final int access, final String name,
final String signature, final String superName,
final String[] interfaces) {
p.visit(version, access, name, signature, superName, interfaces);
super.visit(version, access, name, signature, superName, interfaces);
}
@Override
public void visitSource(final String file, final String debug) {
p.visitSource(file, debug);
super.visitSource(file, debug);
}
@Override
public void visitOuterClass(final String owner, final String name,
final String desc) {
p.visitOuterClass(owner, name, desc);
super.visitOuterClass(owner, name, desc);
}
@Override
public AnnotationVisitor visitAnnotation(final String desc,
final boolean visible) {
Printer p = this.p.visitClassAnnotation(desc, visible);
AnnotationVisitor av = cv == null ? null : cv.visitAnnotation(desc,
visible);
return new TraceAnnotationVisitor(av, p);
}
@Override
public AnnotationVisitor visitTypeAnnotation(int typeRef,
TypePath typePath, String desc, boolean visible) {
Printer p = this.p.visitClassTypeAnnotation(typeRef, typePath, desc,
visible);
AnnotationVisitor av = cv == null ? null : cv.visitTypeAnnotation(
typeRef, typePath, desc, visible);
return new TraceAnnotationVisitor(av, p);
}
@Override
public void visitAttribute(final Attribute attr) {
p.visitClassAttribute(attr);
super.visitAttribute(attr);
}
@Override
public void visitInnerClass(final String name, final String outerName,
final String innerName, final int access) {
p.visitInnerClass(name, outerName, innerName, access);
super.visitInnerClass(name, outerName, innerName, access);
}
@Override
public FieldVisitor visitField(final int access, final String name,
final String desc, final String signature, final Object value) {
Printer p = this.p.visitField(access, name, desc, signature, value);
FieldVisitor fv = cv == null ? null : cv.visitField(access, name, desc,
signature, value);
return new TraceFieldVisitor(fv, p);
}
@Override
public MethodVisitor visitMethod(final int access, final String name,
final String desc, final String signature, final String[] exceptions) {
Printer p = this.p.visitMethod(access, name, desc, signature,
exceptions);
MethodVisitor mv = cv == null ? null : cv.visitMethod(access, name,
desc, signature, exceptions);
return new TraceMethodVisitor(mv, p);
}
@Override
public void visitEnd() {
p.visitClassEnd();
if (pw != null) {
p.print(pw);
pw.flush();
}
super.visitEnd();
}
}
| lgpl-3.0 |
IMSGlobal/caliper-java-public | src/main/java/org/imsglobal/caliper/entities/agent/CourseOffering.java | 3749 | /**
* This file is part of IMS Caliper Analytics™ and is licensed to
* IMS Global Learning Consortium, Inc. (http://www.imsglobal.org)
* under one or more contributor license agreements. See the NOTICE
* file distributed with this work for additional information.
*
* IMS Caliper is free software: you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, version 3 of the License.
*
* IMS Caliper is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.imsglobal.caliper.entities.agent;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.imsglobal.caliper.entities.EntityType;
import javax.annotation.Nullable;
/**
* A CourseOffering is the occurrence of a course in a specific term, semester, etc. A Caliper
* CourseOffering provides a subset of the CourseOffering properties specified in the IMS LTI 2.0
* specification, which in turn, draws inspiration from the IMS LIS 1.0 specification.
*/
public class CourseOffering extends AbstractOrganization {
@JsonProperty("courseNumber")
private final String courseNumber;
@JsonProperty("academicSession")
private final String academicSession;
/**
* @param builder apply builder object properties to the object.
*/
protected CourseOffering(Builder<?> builder) {
super(builder);
this.courseNumber = builder.courseNumber;
this.academicSession = builder.academicSession;
}
/**
* The course number, such as "Biology 101". In general, this number is not simply a numeric value.
* @return the course number.
*/
@Nullable
public String getCourseNumber() {
return courseNumber;
}
/**
* @return academic session
*/
@Nullable
public String getAcademicSession() {
return academicSession;
}
/**
* Builder class provides a fluid interface for setting object properties.
* @param <T> builder.
*/
public static abstract class Builder<T extends Builder<T>> extends AbstractOrganization.Builder<T> {
private String courseNumber;
private String academicSession;
/**
* Constructor
*/
public Builder() {
super.type(EntityType.COURSE_OFFERING);
}
/**
* @param courseNumber
* @return builder.
*/
public T courseNumber(String courseNumber) {
this.courseNumber = courseNumber;
return self();
}
/**
* @param academicSession
* @return builder.
*/
public T academicSession(String academicSession) {
this.academicSession = academicSession;
return self();
}
/**
* Client invokes build method in order to create an immutable object.
* @return a new instance of the CourseOffering.
*/
public CourseOffering build() {
return new CourseOffering(this);
}
}
/**
*
*/
private static class Builder2 extends Builder<Builder2> {
@Override
protected Builder2 self() {
return this;
}
}
/**
* Static factory method.
* @return a new instance of the builder.
*/
public static Builder<?> builder() {
return new Builder2();
}
} | lgpl-3.0 |
bitctrl/de.bsvrz.sys.funclib.bitctrl.dua | src/main/java/de/bsvrz/sys/funclib/bitctrl/dua/lve/package-info.java | 1140 | /*
* Allgemeine Funktionen für das Segment DuA Copyright (C) 2007-2015 BitCtrl
* Systems GmbH
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Contact Information: BitCtrl Systems GmbH Weißenfelser Straße 67 04229
* Leipzig Phone: +49 341-490670 mailto: info@bitctrl.de
*/
/**
* Allgemeine Klassen zum Auslesen aller für die DUA notwendigen Informationen
* eines Straßennetzes.
*/
package de.bsvrz.sys.funclib.bitctrl.dua.lve;
| lgpl-3.0 |
eenbp/OpenNaaS-0.14-Marketplace | extensions/bundles/router.actionsets.junos/src/main/java/org/opennaas/extensions/router/junos/actionssets/actions/staticroute/CreateStaticRouteAction.java | 4453 | package org.opennaas.extensions.router.junos.actionssets.actions.staticroute;
import java.util.HashMap;
import java.util.Map;
import org.opennaas.extensions.router.junos.actionssets.ActionConstants;
import org.opennaas.extensions.router.junos.actionssets.actions.JunosAction;
import org.opennaas.extensions.router.junos.commandsets.commands.EditNetconfCommand;
import org.opennaas.extensions.router.model.ComputerSystem;
import org.opennaas.extensions.router.model.EnabledLogicalElement.EnabledState;
import org.opennaas.extensions.router.model.utils.IPUtilsHelper;
import org.opennaas.core.resources.action.ActionException;
import org.opennaas.core.resources.action.ActionResponse;
import org.opennaas.core.resources.command.Response;
import org.opennaas.core.resources.protocol.IProtocolSession;
/**
* @author Jordi Puig
*/
public class CreateStaticRouteAction extends JunosAction {
private static final String VELOCITY_TEMPLATE = "/VM_files/createStaticRoute.vm";
private static final String PROTOCOL_NAME = "netconf";
/**
*
*/
public CreateStaticRouteAction() {
setActionID(ActionConstants.STATIC_ROUTE_CREATE);
setTemplate(VELOCITY_TEMPLATE);
this.protocolName = PROTOCOL_NAME;
}
/**
* Send the command to the protocol session
*
* @param actionResponse
* @param protocol
* @throws ActionException
*/
@Override
public void executeListCommand(ActionResponse actionResponse, IProtocolSession protocol) throws ActionException {
try {
EditNetconfCommand command = new EditNetconfCommand(getVelocityMessage());
command.initialize();
Response response = sendCommandToProtocol(command, protocol);
actionResponse.addResponse(response);
} catch (Exception e) {
throw new ActionException(this.actionID, e);
}
validateAction(actionResponse);
}
/**
* Create the velocity template to send info to the Junos device
*
* @throws ActionException
*/
@Override
public void prepareMessage() throws ActionException {
validate();
try {
String elementName = "";
if (((ComputerSystem) modelToUpdate).getElementName() != null) {
// is logicalRouter, add LRName param
elementName = ((ComputerSystem) modelToUpdate).getElementName();
}
Map<String, Object> extraParams = new HashMap<String, Object>();
extraParams.put("disabledState", EnabledState.DISABLED.toString());
extraParams.put("enableState", EnabledState.ENABLED.toString());
extraParams.put("ipUtilsHelper", IPUtilsHelper.class);
extraParams.put("elementName", elementName);
setVelocityMessage(prepareVelocityCommand(params, template, extraParams));
} catch (Exception e) {
throw new ActionException(e);
}
}
/**
* We do not have to do anything with the response
*
* @param responseMessage
* @param model
* @throws ActionException
*/
@Override
public void parseResponse(Object responseMessage, Object model) throws ActionException {
// Nothing to do
}
/**
* Params must be a String[]
*
* @param params
* it should be a String[]
* @return false if params is null, is not a String[], lenght != 3 or not have the pattern [0..255].[0..255].[0..255].[0..255]
*/
@Override
public boolean checkParams(Object params) {
boolean paramsOK = true;
// First we check the params object
if (params == null || !(params instanceof String[])) {
paramsOK = false;
} else {
String[] aParams = (String[]) params;
if (aParams.length != 3) {
paramsOK = false;
} else if (!IPUtilsHelper
.validateIpAddressPattern(aParams[0]) ||
!IPUtilsHelper
.validateIpAddressPattern(aParams[1]) ||
!IPUtilsHelper
.validateIpAddressPattern(aParams[2])) {
paramsOK = false;
}
}
return paramsOK;
}
/**
* @param template
* @throws ActionException
* if template is null or empty
*/
private boolean checkTemplate(String template) throws ActionException {
boolean templateOK = true;
// The template can not be null or empty
if (template == null || template.equals("")) {
templateOK = false;
}
return templateOK;
}
/**
* @throws ActionException
*/
private void validate() throws ActionException {
if (!checkTemplate(template)) {
throw new ActionException("The path to Velocity template in Action " + getActionID() + " is null");
}
// Check the params
if (!checkParams(params)) {
throw new ActionException("Invalid parameters for action " + getActionID());
}
}
} | lgpl-3.0 |
elifesy/jemma | jemma.osgi.ah.zigbee.appliances/src/main/java/org/energy_home/jemma/ah/zigbee/appliances/ZclBitronhomeRemoteControlApplianceFactory.java | 2549 | /**
* This file is part of JEMMA - http://jemma.energy-home.org
* (C) Copyright 2014 Istituto Superiore Mario Boella (http://www.ismb.it)
*
* JEMMA is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License (LGPL) version 3
* or later as published by the Free Software Foundation, which accompanies
* this distribution and is available at http://www.gnu.org/licenses/lgpl.html
*
* JEMMA is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License (LGPL) for more details.
*
*/
package org.energy_home.jemma.ah.zigbee.appliances;
import java.util.Dictionary;
import org.energy_home.jemma.ah.hac.ApplianceException;
import org.energy_home.jemma.ah.hac.IApplianceDescriptor;
import org.energy_home.jemma.ah.hac.lib.Appliance;
import org.energy_home.jemma.ah.hac.lib.ApplianceDescriptor;
import org.energy_home.jemma.ah.hac.lib.DriverApplianceFactory;
import org.osgi.service.device.Driver;
/**
*
* @author ISMB-Pert
*
* bitronhome 4-Buttons Remote Control
* * the ZigbeeManger Match filter
* Adding bitronhome Remote Control [deviceProperties Key Value pairs]
* {
* zigbee.device.eps.number=1,
* zigbee.device.device.id=6,
* zigbee.device.eps=[Ljava.lang.String;@f0f6ac,
* service.pid=5149013002559736,
* zigbee.device.ep.id=1,
* DEVICE_SERIAL=5149013002559736,
* DEVICE_CATEGORY=ZigBee,
* zigbee.device.profile.id=260,
* zigbee.device.manufacturer.id=0
* }
*/
public class ZclBitronhomeRemoteControlApplianceFactory extends DriverApplianceFactory implements Driver {
public static final String APPLIANCE_TYPE = "org.energy_home.jemma.ah.zigbee.bitronhome.remotecontrol";
public static final String APPLIANCE_FRIENDLY_NAME = "bitronhome remote control [which includes 4 buttons]";
public static final String DEVICE_TYPE = "ZigBee";
public static final IApplianceDescriptor APPLIANCE_DESCRIPTOR = new ApplianceDescriptor(APPLIANCE_TYPE, null,
APPLIANCE_FRIENDLY_NAME);
public IApplianceDescriptor getDescriptor() {
return APPLIANCE_DESCRIPTOR;
}
public Appliance getInstance(String pid, Dictionary config) throws ApplianceException {
return new ZclBitronhomeRemoteControlAppliance(pid, config);
}
public String deviceMatchFilterString() {
String result = "(&(DEVICE_CATEGORY=ZigBee)(zigbee.device.device.id=6))";
return result;
}
} | lgpl-3.0 |
michaelpetruzzellocivicom/ari4java | classes/ch/loway/oss/ari4java/generated/ari_1_0_0/AriBuilder_impl_ari_1_0_0.java | 7595 | package ch.loway.oss.ari4java.generated.ari_1_0_0;
// ----------------------------------------------------
// THIS CLASS WAS GENERATED AUTOMATICALLY
// PLEASE DO NOT EDIT
// Generated on: Tue Dec 19 09:55:49 CET 2017
// ----------------------------------------------------
import ch.loway.oss.ari4java.generated.ari_1_0_0.models.*;
import ch.loway.oss.ari4java.generated.ari_1_0_0.actions.*;
import ch.loway.oss.ari4java.generated.*;
import ch.loway.oss.ari4java.ARI;
public class AriBuilder_impl_ari_1_0_0 implements AriBuilder {
public ActionEndpoints actionEndpoints() {
return new ActionEndpoints_impl_ari_1_0_0();
};
public ActionRecordings actionRecordings() {
return new ActionRecordings_impl_ari_1_0_0();
};
public ActionSounds actionSounds() {
return new ActionSounds_impl_ari_1_0_0();
};
public ActionChannels actionChannels() {
return new ActionChannels_impl_ari_1_0_0();
};
public ActionEvents actionEvents() {
return new ActionEvents_impl_ari_1_0_0();
};
public ActionBridges actionBridges() {
return new ActionBridges_impl_ari_1_0_0();
};
public ActionDeviceStates actionDeviceStates() {
return new ActionDeviceStates_impl_ari_1_0_0();
};
public ActionApplications actionApplications() {
return new ActionApplications_impl_ari_1_0_0();
};
public ActionAsterisk actionAsterisk() {
return new ActionAsterisk_impl_ari_1_0_0();
};
public ActionPlaybacks actionPlaybacks() {
return new ActionPlaybacks_impl_ari_1_0_0();
};
public Endpoint endpoint() {
return new Endpoint_impl_ari_1_0_0();
};
public RecordingFailed recordingFailed() {
return new RecordingFailed_impl_ari_1_0_0();
};
public ChannelLeftBridge channelLeftBridge() {
return new ChannelLeftBridge_impl_ari_1_0_0();
};
public DeviceStateChanged deviceStateChanged() {
return new DeviceStateChanged_impl_ari_1_0_0();
};
public DeviceState deviceState() {
return new DeviceState_impl_ari_1_0_0();
};
public BuildInfo buildInfo() {
return new BuildInfo_impl_ari_1_0_0();
};
public Event event() {
return new Event_impl_ari_1_0_0();
};
public Application application() {
return new Application_impl_ari_1_0_0();
};
public FormatLangPair formatLangPair() {
return new FormatLangPair_impl_ari_1_0_0();
};
public Message message() {
return new Message_impl_ari_1_0_0();
};
public LiveRecording liveRecording() {
return new LiveRecording_impl_ari_1_0_0();
};
public ChannelDialplan channelDialplan() {
return new ChannelDialplan_impl_ari_1_0_0();
};
public PlaybackFinished playbackFinished() {
return new PlaybackFinished_impl_ari_1_0_0();
};
public ChannelDestroyed channelDestroyed() {
return new ChannelDestroyed_impl_ari_1_0_0();
};
public ChannelDtmfReceived channelDtmfReceived() {
return new ChannelDtmfReceived_impl_ari_1_0_0();
};
public Dial dial() {
return new Dial_impl_ari_1_0_0();
};
public MissingParams missingParams() {
return new MissingParams_impl_ari_1_0_0();
};
public SystemInfo systemInfo() {
return new SystemInfo_impl_ari_1_0_0();
};
public ConfigInfo configInfo() {
return new ConfigInfo_impl_ari_1_0_0();
};
public RecordingStarted recordingStarted() {
return new RecordingStarted_impl_ari_1_0_0();
};
public Variable variable() {
return new Variable_impl_ari_1_0_0();
};
public Playback playback() {
return new Playback_impl_ari_1_0_0();
};
public PlaybackStarted playbackStarted() {
return new PlaybackStarted_impl_ari_1_0_0();
};
public EndpointStateChange endpointStateChange() {
return new EndpointStateChange_impl_ari_1_0_0();
};
public BridgeCreated bridgeCreated() {
return new BridgeCreated_impl_ari_1_0_0();
};
public ChannelStateChange channelStateChange() {
return new ChannelStateChange_impl_ari_1_0_0();
};
public StasisStart stasisStart() {
return new StasisStart_impl_ari_1_0_0();
};
public ChannelHangupRequest channelHangupRequest() {
return new ChannelHangupRequest_impl_ari_1_0_0();
};
public Bridge bridge() {
return new Bridge_impl_ari_1_0_0();
};
public CallerID callerID() {
return new CallerID_impl_ari_1_0_0();
};
public BridgeMerged bridgeMerged() {
return new BridgeMerged_impl_ari_1_0_0();
};
public ApplicationReplaced applicationReplaced() {
return new ApplicationReplaced_impl_ari_1_0_0();
};
public ChannelCreated channelCreated() {
return new ChannelCreated_impl_ari_1_0_0();
};
public ChannelVarset channelVarset() {
return new ChannelVarset_impl_ari_1_0_0();
};
public ChannelCallerId channelCallerId() {
return new ChannelCallerId_impl_ari_1_0_0();
};
public Dialed dialed() {
return new Dialed_impl_ari_1_0_0();
};
public StatusInfo statusInfo() {
return new StatusInfo_impl_ari_1_0_0();
};
public StoredRecording storedRecording() {
return new StoredRecording_impl_ari_1_0_0();
};
public BridgeDestroyed bridgeDestroyed() {
return new BridgeDestroyed_impl_ari_1_0_0();
};
public DialplanCEP dialplanCEP() {
return new DialplanCEP_impl_ari_1_0_0();
};
public StasisEnd stasisEnd() {
return new StasisEnd_impl_ari_1_0_0();
};
public RecordingFinished recordingFinished() {
return new RecordingFinished_impl_ari_1_0_0();
};
public SetId setId() {
return new SetId_impl_ari_1_0_0();
};
public AsteriskInfo asteriskInfo() {
return new AsteriskInfo_impl_ari_1_0_0();
};
public Channel channel() {
return new Channel_impl_ari_1_0_0();
};
public ChannelUserevent channelUserevent() {
return new ChannelUserevent_impl_ari_1_0_0();
};
public Sound sound() {
return new Sound_impl_ari_1_0_0();
};
public ChannelEnteredBridge channelEnteredBridge() {
return new ChannelEnteredBridge_impl_ari_1_0_0();
};
public BridgeAttendedTransfer bridgeAttendedTransfer() {
throw new UnsupportedOperationException();
};
public BridgeBlindTransfer bridgeBlindTransfer() {
throw new UnsupportedOperationException();
};
public BridgeVideoSourceChanged bridgeVideoSourceChanged() {
throw new UnsupportedOperationException();
};
public ChannelConnectedLine channelConnectedLine() {
throw new UnsupportedOperationException();
};
public ChannelHold channelHold() {
throw new UnsupportedOperationException();
};
public ChannelTalkingFinished channelTalkingFinished() {
throw new UnsupportedOperationException();
};
public ChannelTalkingStarted channelTalkingStarted() {
throw new UnsupportedOperationException();
};
public ChannelUnhold channelUnhold() {
throw new UnsupportedOperationException();
};
public ConfigTuple configTuple() {
throw new UnsupportedOperationException();
};
public ContactInfo contactInfo() {
throw new UnsupportedOperationException();
};
public ContactStatusChange contactStatusChange() {
throw new UnsupportedOperationException();
};
public LogChannel logChannel() {
throw new UnsupportedOperationException();
};
public Module module() {
throw new UnsupportedOperationException();
};
public Peer peer() {
throw new UnsupportedOperationException();
};
public PeerStatusChange peerStatusChange() {
throw new UnsupportedOperationException();
};
public PlaybackContinuing playbackContinuing() {
throw new UnsupportedOperationException();
};
public TextMessage textMessage() {
throw new UnsupportedOperationException();
};
public TextMessageReceived textMessageReceived() {
throw new UnsupportedOperationException();
};
public TextMessageVariable textMessageVariable() {
throw new UnsupportedOperationException();
};
public ARI.ClassFactory getClassFactory() {
return new ClassTranslator_impl_ari_1_0_0();
};
};
| lgpl-3.0 |
herculeshssj/orcamento | orcamento/src/main/java/br/com/hslife/orcamento/facade/IFechamentoPeriodo.java | 1856 | /***
Copyright (c) 2012 - 2021 Hércules S. S. José
Este arquivo é parte do programa Orçamento Doméstico.
Orçamento Doméstico é um software livre; você pode redistribui-lo e/ou
modificá-lo dentro dos termos da Licença Pública Geral Menor GNU como
publicada pela Fundação do Software Livre (FSF); na versão 3.0 da
Licença.
Este programa é distribuído na esperança que possa ser útil, mas SEM
NENHUMA GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer
MERCADO ou APLICAÇÃO EM PARTICULAR. Veja a Licença Pública Geral Menor
GNU em português para maiores detalhes.
Você deve ter recebido uma cópia da Licença Pública Geral Menor GNU sob
o nome de "LICENSE" junto com este programa, se não, acesse o site do
projeto no endereco https://github.com/herculeshssj/orcamento ou escreva
para a Fundação do Software Livre(FSF) Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301, USA.
Para mais informações sobre o programa Orçamento Doméstico e seu autor
entre em contato pelo e-mail herculeshssj@outlook.com, ou ainda escreva
para Hércules S. S. José, Rua José dos Anjos, 160 - Bl. 3 Apto. 304 -
Jardim Alvorada - CEP: 26261-130 - Nova Iguaçu, RJ, Brasil.
***/
package br.com.hslife.orcamento.facade;
import java.util.Date;
import java.util.List;
import br.com.hslife.orcamento.entity.Conta;
import br.com.hslife.orcamento.entity.LancamentoConta;
import br.com.hslife.orcamento.entity.LancamentoPeriodico;
public interface IFechamentoPeriodo {
void fecharPeriodo(Conta conta, Date dataInicio, Date dataFim);
void fecharPeriodo(Conta conta, Date dataInicio, Date dataFim, List<LancamentoPeriodico> lancamentosPeriodicos);
void reabrirPeriodo(Conta conta, Date dataInicio, Date dataFim);
void registrarPagamento(LancamentoConta pagamentoPeriodo);
}
| lgpl-3.0 |
yawlfoundation/yawl | src/org/yawlfoundation/yawl/balancer/RequestDumpUtil.java | 4886 | /*
* Copyright (c) 2004-2020 The YAWL Foundation. All rights reserved.
* The YAWL Foundation is a collaboration of individuals and
* organisations who are committed to improving workflow technology.
*
* This file is part of YAWL. YAWL is free software: you can
* redistribute it and/or modify it under the terms of the GNU Lesser
* General Public License as published by the Free Software Foundation.
*
* YAWL is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with YAWL. If not, see <http://www.gnu.org/licenses/>.
*/
package org.yawlfoundation.yawl.balancer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.util.Enumeration;
/**
* @author Michael Adams
* @date 14/8/17
*/
public class RequestDumpUtil {
private static final String INDENT = "\t";
private static final String LF = "\n";
public static String dump(HttpServletRequest request) {
StringBuilder sb = new StringBuilder();
sb.append("REQUEST:\n");
dumpRequest(sb, request);
sb.append("HEADERS:\n");
dumpRequestHeader(sb, request);
sb.append("PARAMS:\n");
dumpRequestParameter(sb, request);
sb.append("ATTRIBUTES:");
dumpRequestSessionAttribute(sb, request);
return sb.toString();
}
public static void dumpRequest(StringBuilder sb, HttpServletRequest request) {
sb.append(INDENT).append("[Class] ").append(request.getClass().getName()).append(", instance=" + request.toString().trim()).append(LF);
sb.append(INDENT).append("[RequestedSessionId] ").append(request.getRequestedSessionId()).append(LF);
sb.append(INDENT).append("[RequestURI] ").append(request.getRequestURI()).append(LF);
sb.append(INDENT).append("[ServletPath] ").append(request.getServletPath()).append(LF);
sb.append(INDENT).append("[CharacterEncoding] ").append(request.getCharacterEncoding()).append(LF);
sb.append(INDENT).append("[ContentLength] ").append(request.getContentLength()).append(LF);
sb.append(INDENT).append("[ContentType] ").append(request.getContentType()).append(LF);
sb.append(INDENT).append("[Locale] ").append(request.getLocale()).append(LF);
sb.append(INDENT).append("[Scheme] ").append(request.getScheme()).append(LF);
sb.append(INDENT).append("[isSecure] ").append(request.isSecure()).append(LF);
sb.append(INDENT).append("[Protocol] ").append(request.getProtocol()).append(LF);
sb.append(INDENT).append("[RemoteAddr] ").append(request.getRemoteAddr()).append(LF);
sb.append(INDENT).append("[RemoteHost] ").append(request.getRemoteHost()).append(LF);
sb.append(INDENT).append("[ServerName] ").append(request.getServerName()).append(LF);
sb.append(INDENT).append("[ServerPort] ").append(request.getServerPort()).append(LF);
sb.append(INDENT).append("[ContextPath] ").append(request.getContextPath()).append(LF);
sb.append(INDENT).append("[Method] ").append(request.getMethod()).append(LF);
sb.append(INDENT).append("[QueryString] ").append(request.getQueryString()).append(LF);
sb.append(INDENT).append("[PathInfo] ").append(request.getPathInfo()).append(LF);
sb.append(INDENT).append("[RemoteUser] ").append(request.getRemoteUser()).append(LF);
}
public static void dumpRequestHeader(StringBuilder sb, HttpServletRequest request) {
Enumeration<String> hNames = request.getHeaderNames();
while (hNames.hasMoreElements()) {
String name = hNames.nextElement();
sb.append(INDENT).append("[header] ").append(name).append("=").append(request.getHeader(name)).append(LF);
}
}
public static void dumpRequestParameter(StringBuilder sb, HttpServletRequest request) {
Enumeration<String> pNames = request.getParameterNames();
while (pNames.hasMoreElements()) {
String name = pNames.nextElement();
sb.append(INDENT).append("[param] ").append(name).append("=").append(request.getParameter(name)).append(LF);
}
}
public static void dumpRequestSessionAttribute(StringBuilder sb, HttpServletRequest request) {
HttpSession session = request.getSession();
if (session != null) {
Enumeration<String> aNames = session.getAttributeNames();
while (aNames.hasMoreElements()) {
String name = aNames.nextElement();
sb.append(INDENT).append("[session] ").append(name).append("=").append(session.getAttribute(name)).append(LF);
}
}
}
}
| lgpl-3.0 |
alex73/mmscomputing | src/uk/co/mmscomputing/io/ModHuffmanOutputStream.java | 2361 | package uk.co.mmscomputing.io;
import java.io.*;
public class ModHuffmanOutputStream extends BitOutputStream implements ModHuffmanTable{
protected int state=WHITE;
public ModHuffmanOutputStream(){
super();
state=WHITE;
}
public ModHuffmanOutputStream(OutputStream out){
super(out);
state=WHITE;
}
public void flush()throws IOException{
super.flush();
state=WHITE;
}
public void reset()throws IOException{
super.reset();
state=WHITE;
}
public int getState(){
return state;
}
public void writeEOL()throws IOException{
super.flush();
write(0,4);write(EOLCW,12);
state=WHITE;
}
public void write(int runlen)throws IOException{
if(state==WHITE){ writeWhite(runlen);state=BLACK;
}else{ writeBlack(runlen);state=WHITE;
}
}
private void writeWhite(int runlen)throws IOException{
int[] rle;
while(runlen>2623){ // 2560+63=2623
write(0x00000F80,12);
runlen-=2560;
}
if(runlen>63){ // max 2560
int makeup=runlen/64-1;
rle=makeUpWhite[makeup];
write(rle[0],rle[2]);
}
rle=termWhite[runlen&0x3F]; // max 63
write(rle[0],rle[2]);
}
private void writeBlack(int runlen)throws IOException{
int[] rle;
while(runlen>2623){ // 2560+63=2623
write(0x00000F80,12);
runlen-=2560;
}
if(runlen>63){ // max 2560
int makeup=runlen/64-1;
rle=makeUpBlack[makeup];
write(rle[0],rle[2]);
}
rle=termBlack[runlen&0x3F]; // max 63
write(rle[0],rle[2]);
}
public static void main(String[] argv){
try{
ByteArrayOutputStream baos=new ByteArrayOutputStream();
ModHuffmanOutputStream mhos=new ModHuffmanOutputStream(baos);
mhos.writeWhite(1728); // 1728 white standard G3 fax line => B2 59 01
// mhos.writeWhite(2048); // 2048 white B4 fax line => 80 CC 0A
// mhos.writeWhite(2432); // 2432 white A3 fax line => 80 CD 0A
mhos.flush();mhos.close();
byte[] buf=baos.toByteArray();
for(int i=0;i<buf.length;i++){
System.out.println("["+i+"]="+Integer.toHexString(buf[i]&0x000000FF));
}
}catch(Exception e){
e.printStackTrace();
}
}
} | lgpl-3.0 |
Ortolang/diffusion | comp/src/test/java/fr/ortolang/diffusion/SaveParamsAction.java | 2309 | package fr.ortolang.diffusion;
/*
* #%L
* ORTOLANG
* A online network structure for hosting language resources and tools.
*
* Jean-Marie Pierrel / ATILF UMR 7118 - CNRS / Université de Lorraine
* Etienne Petitjean / ATILF UMR 7118 - CNRS
* Jérôme Blanchard / ATILF UMR 7118 - CNRS
* Bertrand Gaiffe / ATILF UMR 7118 - CNRS
* Cyril Pestel / ATILF UMR 7118 - CNRS
* Marie Tonnelier / ATILF UMR 7118 - CNRS
* Ulrike Fleury / ATILF UMR 7118 - CNRS
* Frédéric Pierre / ATILF UMR 7118 - CNRS
* Céline Moro / ATILF UMR 7118 - CNRS
*
* This work is based on work done in the equipex ORTOLANG (http://www.ortolang.fr/), by several Ortolang contributors (mainly CNRTL and SLDR)
* ORTOLANG is funded by the French State program "Investissements d'Avenir" ANR-11-EQPX-0032
* %%
* Copyright (C) 2013 - 2015 Ortolang Team
* %%
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* 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 Lesser Public License for more details.
*
* You should have received a copy of the GNU General Lesser Public
* License along with this program. If not, see
* <http://www.gnu.org/licenses/lgpl-3.0.html>.
* #L%
*/
import java.util.Vector;
import org.hamcrest.Description;
import org.jmock.api.Action;
import org.jmock.api.Invocation;
public class SaveParamsAction implements Action {
private Vector<Object> params;
public SaveParamsAction(Vector<Object> params) {
this.params = params;
}
public Object invoke(Invocation invocation) throws Throwable {
for (Object param : invocation.getParametersAsArray()) {
params.add(param);
}
return null;
}
public void describeTo(Description description) {
description.appendText("save params in ");
description.appendValue(params);
}
public static <T> Action saveParams(Vector<Object> params) {
return new SaveParamsAction(params);
}
} | lgpl-3.0 |
jjettenn/molgenis | molgenis-data-mapper/src/main/java/org/molgenis/data/mapper/controller/MappingServiceController.java | 36771 | package org.molgenis.data.mapper.controller;
import com.google.common.collect.*;
import org.apache.commons.lang3.StringUtils;
import org.molgenis.auth.User;
import org.molgenis.data.*;
import org.molgenis.data.aggregation.AggregateResult;
import org.molgenis.data.importer.wizard.ImportWizardController;
import org.molgenis.data.mapper.data.request.GenerateAlgorithmRequest;
import org.molgenis.data.mapper.data.request.MappingServiceRequest;
import org.molgenis.data.mapper.mapping.model.*;
import org.molgenis.data.mapper.mapping.model.AttributeMapping.AlgorithmState;
import org.molgenis.data.mapper.service.AlgorithmService;
import org.molgenis.data.mapper.service.MappingService;
import org.molgenis.data.mapper.service.impl.AlgorithmEvaluation;
import org.molgenis.data.meta.model.Attribute;
import org.molgenis.data.meta.model.EntityType;
import org.molgenis.data.semantic.Relation;
import org.molgenis.data.semanticsearch.explain.bean.ExplainedAttribute;
import org.molgenis.data.semanticsearch.service.OntologyTagService;
import org.molgenis.data.semanticsearch.service.SemanticSearchService;
import org.molgenis.data.support.AggregateQueryImpl;
import org.molgenis.data.support.EntityTypeUtils;
import org.molgenis.data.support.QueryImpl;
import org.molgenis.dataexplorer.controller.DataExplorerController;
import org.molgenis.ontology.core.model.OntologyTerm;
import org.molgenis.security.core.runas.RunAsSystemProxy;
import org.molgenis.security.user.UserService;
import org.molgenis.ui.MolgenisPluginController;
import org.molgenis.ui.menu.MenuReaderService;
import org.molgenis.util.ErrorMessageResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static com.google.common.collect.Lists.newArrayList;
import static java.util.stream.Collectors.toList;
import static org.molgenis.data.mapper.controller.MappingServiceController.URI;
import static org.molgenis.data.mapper.mapping.model.CategoryMapping.create;
import static org.molgenis.data.mapper.mapping.model.CategoryMapping.createEmpty;
import static org.molgenis.security.core.utils.SecurityUtils.currentUserIsSu;
import static org.molgenis.security.core.utils.SecurityUtils.getCurrentUsername;
import static org.springframework.http.MediaType.APPLICATION_JSON_VALUE;
@Controller
@RequestMapping(URI)
public class MappingServiceController extends MolgenisPluginController
{
private static final Logger LOG = LoggerFactory.getLogger(MappingServiceController.class);
public static final String ID = "mappingservice";
public static final String URI = MolgenisPluginController.PLUGIN_URI_PREFIX + ID;
private static final String VIEW_MAPPING_PROJECTS = "view-mapping-projects";
private static final String VIEW_ATTRIBUTE_MAPPING = "view-attribute-mapping";
private static final String VIEW_SINGLE_MAPPING_PROJECT = "view-single-mapping-project";
private static final String VIEW_CATEGORY_MAPPING_EDITOR = "view-advanced-mapping-editor";
private static final String VIEW_ATTRIBUTE_MAPPING_FEEDBACK = "view-attribute-mapping-feedback";
@Autowired
private UserService userService;
@Autowired
private MappingService mappingService;
@Autowired
private AlgorithmService algorithmService;
@Autowired
private DataService dataService;
@Autowired
private OntologyTagService ontologyTagService;
@Autowired
private SemanticSearchService semanticSearchService;
@Autowired
private MenuReaderService menuReaderService;
public MappingServiceController()
{
super(URI);
}
/**
* Initializes the model with all mapping projects and all entities to the model.
*
* @param model the model to initialized
* @return view name of the mapping projects list
*/
@RequestMapping
public String viewMappingProjects(Model model)
{
model.addAttribute("mappingProjects", mappingService.getAllMappingProjects());
model.addAttribute("entityTypes", getWritableEntityTypes());
model.addAttribute("user", getCurrentUsername());
model.addAttribute("admin", currentUserIsSu());
model.addAttribute("importerUri", menuReaderService.getMenu().findMenuItemPath(ImportWizardController.ID));
return VIEW_MAPPING_PROJECTS;
}
/**
* Adds a new mapping project.
*
* @param name name of the mapping project
* @param targetEntity name of the project's first {@link MappingTarget}'s target entity
* @return redirect URL for the newly created mapping project
*/
@RequestMapping(value = "/addMappingProject", method = RequestMethod.POST)
public String addMappingProject(@RequestParam("mapping-project-name") String name,
@RequestParam("target-entity") String targetEntity)
{
MappingProject newMappingProject = mappingService.addMappingProject(name, getCurrentUser(), targetEntity);
return "redirect:" + getMappingServiceMenuUrl() + "/mappingproject/" + newMappingProject.getIdentifier();
}
/**
* Removes a mapping project
*
* @param mappingProjectId the ID of the mapping project
* @return redirect url to the same page to force a refresh
*/
@RequestMapping(value = "/removeMappingProject", method = RequestMethod.POST)
public String deleteMappingProject(@RequestParam(required = true) String mappingProjectId)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(project))
{
LOG.info("Deleting mappingProject " + project.getName());
mappingService.deleteMappingProject(mappingProjectId);
}
return "redirect:" + getMappingServiceMenuUrl();
}
/**
* Removes a attribute mapping
*
* @param mappingProjectId the ID of the mapping project
* @param target the target entity
* @param source the source entity
* @param attribute the attribute that is mapped
* @return
*/
@RequestMapping(value = "/removeAttributeMapping", method = RequestMethod.POST)
public String removeAttributeMapping(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
@RequestParam(required = true) String attribute)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(project))
{
project.getMappingTarget(target).getMappingForSource(source).deleteAttributeMapping(attribute);
mappingService.updateMappingProject(project);
}
return "redirect:" + getMappingServiceMenuUrl() + "/mappingproject/" + project.getIdentifier();
}
/**
* Adds a new {@link EntityMapping} to an existing {@link MappingTarget}
*
* @param target the name of the {@link MappingTarget}'s entity to add a source entity to
* @param source the name of the source entity of the newly added {@link EntityMapping}
* @param mappingProjectId the ID of the {@link MappingTarget}'s {@link MappingProject}
* @return redirect URL for the mapping project
*/
@RequestMapping(value = "/addEntityMapping", method = RequestMethod.POST)
public String addEntityMapping(@RequestParam String mappingProjectId, String target, String source)
{
EntityType sourceEntityType = dataService.getEntityType(source);
EntityType targetEntityType = dataService.getEntityType(target);
Iterable<Attribute> attributes = targetEntityType.getAtomicAttributes();
MappingProject project = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(project))
{
EntityMapping mapping = project.getMappingTarget(target).addSource(sourceEntityType);
mappingService.updateMappingProject(project);
autoGenerateAlgorithms(mapping, sourceEntityType, targetEntityType, attributes, project);
}
return "redirect:" + getMappingServiceMenuUrl() + "/mappingproject/" + mappingProjectId;
}
/**
* Removes entity mapping
*
* @param mappingProjectId ID of the mapping project to remove entity mapping from
* @param target entity name of the mapping target
* @param source entity name of the mapping source
* @return redirect url of the mapping project's page
*/
@RequestMapping(value = "/removeEntityMapping", method = RequestMethod.POST)
public String removeEntityMapping(@RequestParam String mappingProjectId, String target, String source)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(project))
{
project.getMappingTarget(target).removeSource(source);
mappingService.updateMappingProject(project);
}
return "redirect:" + getMappingServiceMenuUrl() + "/mappingproject/" + mappingProjectId;
}
@RequestMapping(value = "/validateAttrMapping", method = RequestMethod.POST)
@ResponseBody
public AttributeMappingValidationReport validateAttributeMapping(
@Valid @RequestBody MappingServiceRequest mappingServiceRequest)
{
String targetEntityName = mappingServiceRequest.getTargetEntityName();
EntityType targetEntityType = dataService.getEntityType(targetEntityName);
String targetAttributeName = mappingServiceRequest.getTargetAttributeName();
Attribute targetAttr = targetEntityType.getAttribute(targetAttributeName);
if (targetAttr == null)
{
throw new UnknownAttributeException("Unknown attribute [" + targetAttributeName + "]");
}
String algorithm = mappingServiceRequest.getAlgorithm();
Long offset = mappingServiceRequest.getOffset();
Long num = mappingServiceRequest.getNum();
Query<Entity> query = new QueryImpl<Entity>().offset(offset.intValue()).pageSize(num.intValue());
String sourceEntityName = mappingServiceRequest.getSourceEntityName();
Iterable<Entity> sourceEntities = () -> dataService.findAll(sourceEntityName, query).iterator();
long total = dataService.count(sourceEntityName, new QueryImpl<>());
long nrSuccess = 0, nrErrors = 0;
Map<String, String> errorMessages = new LinkedHashMap<String, String>();
for (AlgorithmEvaluation evaluation : algorithmService.applyAlgorithm(targetAttr, algorithm, sourceEntities))
{
if (evaluation.hasError())
{
errorMessages.put(evaluation.getEntity().getIdValue().toString(), evaluation.getErrorMessage());
++nrErrors;
}
else
{
++nrSuccess;
}
}
return new AttributeMappingValidationReport(total, nrSuccess, nrErrors, errorMessages);
}
private static class AttributeMappingValidationReport
{
private final Long total;
private final Long nrSuccess;
private final Long nrErrors;
private final Map<String, String> errorMessages;
public AttributeMappingValidationReport(Long total, Long nrSuccess, Long nrErrors,
Map<String, String> errorMessages)
{
this.total = total;
this.nrSuccess = nrSuccess;
this.nrErrors = nrErrors;
this.errorMessages = errorMessages;
}
@SuppressWarnings("unused")
public Long getTotal()
{
return total;
}
@SuppressWarnings("unused")
public Long getNrSuccess()
{
return nrSuccess;
}
@SuppressWarnings("unused")
public Long getNrErrors()
{
return nrErrors;
}
@SuppressWarnings("unused")
public Map<String, String> getErrorMessages()
{
return errorMessages;
}
}
/**
* Adds a new {@link AttributeMapping} to an {@link EntityMapping}.
*
* @param mappingProjectId ID of the mapping project
* @param target name of the target entity
* @param source name of the source entity
* @param targetAttribute name of the target attribute
* @param algorithm the mapping algorithm
* @return redirect URL for the attributemapping
*/
@RequestMapping(value = "/saveattributemapping", method = RequestMethod.POST)
public String saveAttributeMapping(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
@RequestParam(required = true) String targetAttribute, @RequestParam(required = true) String algorithm,
@RequestParam(required = true) AlgorithmState algorithmState)
{
MappingProject mappingProject = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(mappingProject))
{
MappingTarget mappingTarget = mappingProject.getMappingTarget(target);
EntityMapping mappingForSource = mappingTarget.getMappingForSource(source);
if (algorithm.isEmpty())
{
mappingForSource.deleteAttributeMapping(targetAttribute);
}
else
{
AttributeMapping attributeMapping = mappingForSource.getAttributeMapping(targetAttribute);
if (attributeMapping == null)
{
attributeMapping = mappingForSource.addAttributeMapping(targetAttribute);
}
attributeMapping.setAlgorithm(algorithm);
attributeMapping.setAlgorithmState(algorithmState);
}
mappingService.updateMappingProject(mappingProject);
}
return "redirect:" + getMappingServiceMenuUrl() + "/mappingproject/" + mappingProject.getIdentifier();
}
/**
* Find the firstattributeMapping skip the the algorithmStates that are given in the {@link AttributeMapping} to an
* {@link EntityMapping}.
*
* @param mappingProjectId ID of the mapping project
* @param target name of the target entity
* @param skipAlgorithmStates the mapping algorithm states that should skip
*/
@RequestMapping(value = "/firstattributemapping", method = RequestMethod.POST)
@ResponseBody
public FirstAttributeMappingInfo getFirstAttributeMappingInfo(
@RequestParam(required = true) String mappingProjectId, @RequestParam(required = true) String target,
@RequestParam(required = true, value = "skipAlgorithmStates[]") List<AlgorithmState> skipAlgorithmStates,
Model model)
{
MappingProject mappingProject = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(mappingProject))
{
MappingTarget mappingTarget = mappingProject.getMappingTarget(target);
List<String> sourceNames = mappingTarget.getEntityMappings().stream()
.map(i -> i.getSourceEntityType().getName()).collect(Collectors.toList());
EntityType targetEntityMeta = mappingTarget.getTarget();
for (Attribute attribute : targetEntityMeta.getAtomicAttributes())
{
if (attribute.equals(targetEntityMeta.getIdAttribute()))
{
continue;
}
for (String source : sourceNames)
{
EntityMapping entityMapping = mappingTarget.getMappingForSource(source);
AttributeMapping attributeMapping = entityMapping.getAttributeMapping(attribute.getName());
if (null != attributeMapping)
{
AlgorithmState algorithmState = attributeMapping.getAlgorithmState();
if (null != skipAlgorithmStates)
{
if (skipAlgorithmStates.contains(algorithmState))
{
continue;
}
}
}
return FirstAttributeMappingInfo.create(mappingProjectId, target, source, attribute.getName());
}
}
}
return null;
}
/**
* Displays a mapping project.
*
* @param identifier identifier of the {@link MappingProject}
* @param target Name of the selected {@link MappingTarget}'s target entity
* @param model the model
* @return View name of the
*/
@RequestMapping("/mappingproject/{id}")
public String viewMappingProject(@PathVariable("id") String identifier,
@RequestParam(value = "target", required = false) String target, Model model)
{
MappingProject project = mappingService.getMappingProject(identifier);
if (target == null)
{
target = project.getMappingTargets().get(0).getName();
}
model.addAttribute("selectedTarget", target);
model.addAttribute("mappingProject", project);
model.addAttribute("entityTypes", getNewSources(project.getMappingTarget(target)));
model.addAttribute("hasWritePermission", hasWritePermission(project, false));
model.addAttribute("attributeTagMap", getTagsForAttribute(target, project));
return VIEW_SINGLE_MAPPING_PROJECT;
}
@RequestMapping(value = "/mappingproject/clone", method = RequestMethod.POST)
public String cloneMappingProject(@RequestParam("mappingProjectId") String mappingProjectId)
{
mappingService.cloneMappingProject(mappingProjectId);
return "forward:" + URI;
}
/**
* This controller will first of all check if the user-defined search terms exist. If so, the searchTerms will be
* used directly in the SemanticSearchService. If the searchTerms are not defined by users, it will use the
* ontologyTermTags in the SemantiSearchService. If neither of the searchTerms and the OntologyTermTags exist, it
* will use the information from the targetAttribute in the SemanticSearchService
* <p>
* If string terms are sent to the SemanticSearchService, they will be first of all converted to the ontologyTerms
* using findTag method
*
* @param requestBody
* @return
*/
@RequestMapping(method = RequestMethod.POST, value = "/attributeMapping/semanticsearch", consumes = APPLICATION_JSON_VALUE)
@ResponseBody
public List<ExplainedAttribute> getSemanticSearchAttributeMapping(@RequestBody Map<String, String> requestBody)
{
String mappingProjectId = requestBody.get("mappingProjectId");
String target = requestBody.get("target");
String source = requestBody.get("source");
String targetAttributeName = requestBody.get("targetAttribute");
String searchTermsString = requestBody.get("searchTerms");
Set<String> searchTerms = new HashSet<String>();
if (StringUtils.isNotBlank(searchTermsString))
{
searchTerms.addAll(Sets.newHashSet(searchTermsString.toLowerCase().split("\\s+or\\s+")).stream()
.filter(term -> StringUtils.isNotBlank(term)).map(term -> term.trim()).collect(Collectors.toSet()));
}
MappingProject project = mappingService.getMappingProject(mappingProjectId);
MappingTarget mappingTarget = project.getMappingTarget(target);
EntityMapping entityMapping = mappingTarget.getMappingForSource(source);
Attribute targetAttribute = entityMapping.getTargetEntityType().getAttribute(targetAttributeName);
// Find relevant attributes base on tags
Multimap<Relation, OntologyTerm> tagsForAttribute = ontologyTagService
.getTagsForAttribute(entityMapping.getTargetEntityType(), targetAttribute);
Map<Attribute, ExplainedAttribute> relevantAttributes = semanticSearchService
.decisionTreeToFindRelevantAttributes(entityMapping.getSourceEntityType(), targetAttribute,
tagsForAttribute.values(), searchTerms);
return newArrayList(relevantAttributes.values());
}
@RequestMapping(method = RequestMethod.POST, value = "/attributemapping/algorithm", consumes = APPLICATION_JSON_VALUE)
@ResponseBody
public String getSuggestedAlgorithm(@RequestBody GenerateAlgorithmRequest generateAlgorithmRequest)
{
EntityType targetEntityType = dataService.getEntityType(generateAlgorithmRequest.getTargetEntityName());
EntityType sourceEntityType = dataService.getEntityType(generateAlgorithmRequest.getSourceEntityName());
Attribute targetAttribute = targetEntityType.getAttribute(generateAlgorithmRequest.getTargetAttributeName());
List<Attribute> sourceAttributes = generateAlgorithmRequest.getSourceAttributes().stream()
.map(name -> sourceEntityType.getAttribute(name)).collect(Collectors.toList());
String generateAlgorithm = algorithmService
.generateAlgorithm(targetAttribute, targetEntityType, sourceAttributes, sourceEntityType);
return generateAlgorithm;
}
/**
* Creates the integrated entity for a mapping project's target
*
* @param mappingProjectId ID of the mapping project
* @param target name of the target of the {@link EntityMapping}
* @param newEntityName name of the new entity to create
* @return redirect URL to the data explorer displaying the newly generated entity
*/
@RequestMapping("/createIntegratedEntity")
public String createIntegratedEntity(@RequestParam String mappingProjectId, @RequestParam String target,
@RequestParam() String newEntityName, @RequestParam(required = false) boolean addSourceAttribute,
Model model)
{
try
{
MappingTarget mappingTarget = mappingService.getMappingProject(mappingProjectId).getMappingTarget(target);
String name = mappingService.applyMappings(mappingTarget, newEntityName, addSourceAttribute);
return "redirect:" + menuReaderService.getMenu().findMenuItemPath(DataExplorerController.ID) + "?entity="
+ name;
}
catch (RuntimeException ex)
{
model.addAttribute("heading", "Failed to create integrated entity.");
model.addAttribute("message", ex.getMessage());
model.addAttribute("href", getMappingServiceMenuUrl() + "/mappingproject/" + mappingProjectId);
return "error-msg";
}
}
/**
* Displays an {@link AttributeMapping}
*
* @param mappingProjectId ID of the {@link MappingProject}
* @param target name of the target entity
* @param source name of the source entity
* @param targetAttribute name of the target attribute
*/
@RequestMapping("/attributeMapping")
public String viewAttributeMapping(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
@RequestParam(required = true) String targetAttribute, Model model)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
MappingTarget mappingTarget = project.getMappingTarget(target);
EntityMapping entityMapping = mappingTarget.getMappingForSource(source);
AttributeMapping attributeMapping = entityMapping.getAttributeMapping(targetAttribute);
if (attributeMapping == null)
{
attributeMapping = entityMapping.addAttributeMapping(targetAttribute);
}
EntityType refEntityType = attributeMapping.getTargetAttribute().getRefEntity();
if (refEntityType != null)
{
Iterable<Entity> refEntities = () -> dataService.findAll(refEntityType.getName()).iterator();
model.addAttribute("categories", refEntities);
}
Multimap<Relation, OntologyTerm> tagsForAttribute = ontologyTagService
.getTagsForAttribute(entityMapping.getTargetEntityType(), attributeMapping.getTargetAttribute());
model.addAttribute("tags", tagsForAttribute.values());
model.addAttribute("dataExplorerUri", menuReaderService.getMenu().findMenuItemPath(DataExplorerController.ID));
model.addAttribute("mappingProject", project);
model.addAttribute("entityMapping", entityMapping);
model.addAttribute("sourceAttributesSize",
Iterables.size(entityMapping.getSourceEntityType().getAtomicAttributes()));
model.addAttribute("attributeMapping", attributeMapping);
model.addAttribute("attributes", newArrayList(dataService.getEntityType(source).getAtomicAttributes()));
model.addAttribute("hasWritePermission", hasWritePermission(project, false));
return VIEW_ATTRIBUTE_MAPPING;
}
@RequestMapping(value = "/attributemappingfeedback", method = RequestMethod.POST)
public String attributeMappingFeedback(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
@RequestParam(required = true) String targetAttribute, @RequestParam(required = true) String algorithm,
Model model)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
MappingTarget mappingTarget = project.getMappingTarget(target);
EntityMapping entityMapping = mappingTarget.getMappingForSource(source);
AttributeMapping algorithmTest;
if (entityMapping.getAttributeMapping(targetAttribute) == null)
{
algorithmTest = entityMapping.addAttributeMapping(targetAttribute);
algorithmTest.setAlgorithm(algorithm);
}
else
{
algorithmTest = entityMapping.getAttributeMapping(targetAttribute);
algorithmTest.setAlgorithm(algorithm);
}
try
{
Collection<String> sourceAttributeNames = algorithmService.getSourceAttributeNames(algorithm);
if (!sourceAttributeNames.isEmpty())
{
List<Attribute> sourceAttributes = sourceAttributeNames.stream()
.map(attributeName -> entityMapping.getSourceEntityType().getAttribute(attributeName))
.collect(Collectors.toList());
model.addAttribute("sourceAttributes", sourceAttributes);
}
}
catch (Exception e)
{
throw new RuntimeException(e);
}
model.addAttribute("mappingProjectId", mappingProjectId);
model.addAttribute("target", target);
model.addAttribute("source", source);
model.addAttribute("targetAttribute", dataService.getEntityType(target).getAttribute(targetAttribute));
FluentIterable<Entity> sourceEntities = FluentIterable.from(() -> dataService.findAll(source).iterator())
.limit(10);
ImmutableList<AlgorithmResult> algorithmResults = sourceEntities.transform(sourceEntity ->
{
try
{
return AlgorithmResult.createSuccess(
algorithmService.apply(algorithmTest, sourceEntity, sourceEntity.getEntityType()),
sourceEntity);
}
catch (Exception e)
{
return AlgorithmResult.createFailure(e, sourceEntity);
}
}).toList();
model.addAttribute("feedbackRows", algorithmResults);
long missing = algorithmResults.stream().filter(r -> r.isSuccess() && r.getValue() == null).count();
long success = algorithmResults.stream().filter(AlgorithmResult::isSuccess).count() - missing;
long error = algorithmResults.size() - success - missing;
model.addAttribute("success", success);
model.addAttribute("missing", missing);
model.addAttribute("error", error);
model.addAttribute("dataexplorerUri", menuReaderService.getMenu().findMenuItemPath(DataExplorerController.ID));
return VIEW_ATTRIBUTE_MAPPING_FEEDBACK;
}
/**
* Returns a view that allows the user to edit mappings involving xrefs / categoricals / strings
*
* @param mappingProjectId
* @param target
* @param source
* @param targetAttribute
* @param sourceAttribute
* @param model
*/
@RequestMapping(value = "/advancedmappingeditor", method = RequestMethod.POST)
public String advancedMappingEditor(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
@RequestParam(required = true) String targetAttribute,
@RequestParam(required = true) String sourceAttribute, @RequestParam String algorithm, Model model)
{
MappingProject project = mappingService.getMappingProject(mappingProjectId);
MappingTarget mappingTarget = project.getMappingTarget(target);
EntityMapping entityMapping = mappingTarget.getMappingForSource(source);
AttributeMapping attributeMapping = entityMapping.getAttributeMapping(targetAttribute);
model.addAttribute("mappingProject", project);
model.addAttribute("entityMapping", entityMapping);
model.addAttribute("attributeMapping", attributeMapping);
// set variables for the target column in the mapping editor
Attribute targetAttr = dataService.getEntityType(target).getAttribute(targetAttribute);
Stream<Entity> targetAttributeEntities;
String targetAttributeIdAttribute = null;
String targetAttributeLabelAttribute = null;
if (EntityTypeUtils.isMultipleReferenceType(targetAttr))
{
targetAttributeEntities = dataService
.findAll(dataService.getEntityType(target).getAttribute(targetAttribute).getRefEntity().getName());
targetAttributeIdAttribute = dataService.getEntityType(target).getAttribute(targetAttribute).getRefEntity()
.getIdAttribute().getName();
targetAttributeLabelAttribute = dataService.getEntityType(target).getAttribute(targetAttribute)
.getRefEntity().getLabelAttribute().getName();
}
else
{
targetAttributeEntities = dataService.findAll(dataService.getEntityType(target).getName());
targetAttributeIdAttribute = dataService.getEntityType(target).getIdAttribute().getName();
targetAttributeLabelAttribute = dataService.getEntityType(target).getLabelAttribute().getName();
}
model.addAttribute("targetAttributeEntities", new Iterable<Entity>()
{
@Override
public Iterator<Entity> iterator()
{
return targetAttributeEntities.iterator();
}
});
model.addAttribute("targetAttributeIdAttribute", targetAttributeIdAttribute);
model.addAttribute("targetAttributeLabelAttribute", targetAttributeLabelAttribute);
// set variables for the source column in the mapping editor
Attribute sourceAttr = dataService.getEntityType(source).getAttribute(sourceAttribute);
Stream<Entity> sourceAttributeEntities;
String sourceAttributeIdAttribute = null;
String sourceAttributeLabelAttribute = null;
if (EntityTypeUtils.isMultipleReferenceType(sourceAttr))
{
sourceAttributeEntities = dataService
.findAll(dataService.getEntityType(source).getAttribute(sourceAttribute).getRefEntity().getName());
sourceAttributeIdAttribute = dataService.getEntityType(source).getAttribute(sourceAttribute).getRefEntity()
.getIdAttribute().getName();
sourceAttributeLabelAttribute = dataService.getEntityType(source).getAttribute(sourceAttribute)
.getRefEntity().getLabelAttribute().getName();
}
else
{
sourceAttributeEntities = dataService.findAll(dataService.getEntityType(source).getName());
sourceAttributeIdAttribute = dataService.getEntityType(source).getIdAttribute().getName();
sourceAttributeLabelAttribute = dataService.getEntityType(source).getLabelAttribute().getName();
}
List<Entity> sourceAttributeEntityList = sourceAttributeEntities.collect(toList());
model.addAttribute("sourceAttributeEntities", sourceAttributeEntityList);
model.addAttribute("numberOfSourceAttributes", sourceAttributeEntityList.size());
model.addAttribute("sourceAttributeIdAttribute", sourceAttributeIdAttribute);
model.addAttribute("sourceAttributeLabelAttribute", sourceAttributeLabelAttribute);
// Check if the selected source attribute is isAggregatable
Attribute sourceAttributeAttribute = dataService.getEntityType(source).getAttribute(sourceAttribute);
if (sourceAttributeAttribute.isAggregatable())
{
AggregateResult aggregate = dataService.aggregate(source,
new AggregateQueryImpl().attrX(sourceAttributeAttribute).query(new QueryImpl<>()));
List<Long> aggregateCounts = new ArrayList<>();
for (List<Long> count : aggregate.getMatrix())
{
aggregateCounts.add(count.get(0));
}
model.addAttribute("aggregates", aggregateCounts);
}
model.addAttribute("target", target);
model.addAttribute("source", source);
model.addAttribute("targetAttribute", dataService.getEntityType(target).getAttribute(targetAttribute));
model.addAttribute("sourceAttribute", dataService.getEntityType(source).getAttribute(sourceAttribute));
model.addAttribute("hasWritePermission", hasWritePermission(project, false));
CategoryMapping<String, String> categoryMapping = null;
if (algorithm == null)
{
algorithm = attributeMapping.getAlgorithm();
}
try
{
categoryMapping = create(algorithm);
}
catch (Exception ignore)
{
}
if (categoryMapping == null)
{
categoryMapping = createEmpty(sourceAttribute);
}
model.addAttribute("categoryMapping", categoryMapping);
return VIEW_CATEGORY_MAPPING_EDITOR;
}
@RequestMapping(value = "/savecategorymapping", method = RequestMethod.POST)
public
@ResponseBody
void saveCategoryMapping(@RequestParam(required = true) String mappingProjectId,
@RequestParam(required = true) String target, @RequestParam(required = true) String source,
@RequestParam(required = true) String targetAttribute, @RequestParam(required = true) String algorithm)
{
MappingProject mappingProject = mappingService.getMappingProject(mappingProjectId);
if (hasWritePermission(mappingProject))
{
MappingTarget mappingTarget = mappingProject.getMappingTarget(target);
EntityMapping mappingForSource = mappingTarget.getMappingForSource(source);
AttributeMapping attributeMapping = mappingForSource.getAttributeMapping(targetAttribute);
if (attributeMapping == null)
{
attributeMapping = mappingForSource.addAttributeMapping(targetAttribute);
}
attributeMapping.setAlgorithm(algorithm);
attributeMapping.setAlgorithmState(AlgorithmState.CURATED);
mappingService.updateMappingProject(mappingProject);
}
}
/**
* Tests an algoritm by computing it for all entities in the source repository.
*
* @param mappingServiceRequest the {@link MappingServiceRequest} sent by the client
* @return Map with the results and size of the source
*/
@RequestMapping(method = RequestMethod.POST, value = "/mappingattribute/testscript", consumes = APPLICATION_JSON_VALUE, produces = APPLICATION_JSON_VALUE)
public
@ResponseBody
Map<String, Object> testScript(@RequestBody MappingServiceRequest mappingServiceRequest)
{
EntityType targetEntityType = dataService.getEntityType(mappingServiceRequest.getTargetEntityName());
Attribute targetAttribute = targetEntityType != null ? targetEntityType
.getAttribute(mappingServiceRequest.getTargetAttributeName()) : null;
Repository<Entity> sourceRepo = dataService.getRepository(mappingServiceRequest.getSourceEntityName());
Iterable<AlgorithmEvaluation> algorithmEvaluations = algorithmService
.applyAlgorithm(targetAttribute, mappingServiceRequest.getAlgorithm(), sourceRepo);
List<Object> calculatedValues = newArrayList(
Iterables.transform(algorithmEvaluations, AlgorithmEvaluation::getValue));
return ImmutableMap.of("results", calculatedValues, "totalCount", Iterables.size(sourceRepo));
}
@ExceptionHandler(RuntimeException.class)
@ResponseBody
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
public ErrorMessageResponse handleRuntimeException(RuntimeException e)
{
LOG.error(e.getMessage(), e);
return new ErrorMessageResponse(new ErrorMessageResponse.ErrorMessage(
"An error occurred. Please contact the administrator.<br />Message:" + e.getMessage()));
}
/**
* Generate algorithms based on semantic matches between attribute tags and descriptions
*
* @param mapping
* @param sourceEntityType
* @param targetEntityType
* @param attributes
* @param project
*/
private void autoGenerateAlgorithms(EntityMapping mapping, EntityType sourceEntityType, EntityType targetEntityType,
Iterable<Attribute> attributes, MappingProject project)
{
attributes.forEach(attribute -> algorithmService
.autoGenerateAlgorithm(sourceEntityType, targetEntityType, mapping, attribute));
mappingService.updateMappingProject(project);
}
/**
* Lists the entities that may be added as new sources to this mapping project's selected target
*
* @param target the selected target
* @return
*/
private List<EntityType> getNewSources(MappingTarget target)
{
return StreamSupport.stream(dataService.getEntityNames().spliterator(), false)
.filter((name) -> isValidSource(target, name)).map(dataService::getEntityType)
.collect(Collectors.toList());
}
private static boolean isValidSource(MappingTarget target, String name)
{
return !target.hasMappingFor(name);
}
private List<EntityType> getEntityTypes()
{
return dataService.getEntityNames().map(dataService::getEntityType).collect(toList());
}
private List<EntityType> getWritableEntityTypes()
{
return getEntityTypes().stream().filter(emd -> !emd.isAbstract())
.filter(emd -> dataService.getCapabilities(emd.getName()).contains(RepositoryCapability.WRITABLE))
.collect(Collectors.toList());
}
private boolean hasWritePermission(MappingProject project)
{
return hasWritePermission(project, true);
}
private boolean hasWritePermission(MappingProject project, boolean logInfractions)
{
boolean result = currentUserIsSu() || project.getOwner().getUsername().equals(getCurrentUsername());
if (logInfractions && !result)
{
LOG.warn("User " + getCurrentUsername() + " illegally tried to modify mapping project with id " + project
.getIdentifier() + " owned by " + project.getOwner().getUsername());
}
return result;
}
private User getCurrentUser()
{
return userService.getUser(getCurrentUsername());
}
private Map<String, List<OntologyTerm>> getTagsForAttribute(String target, MappingProject project)
{
Map<String, List<OntologyTerm>> attributeTagMap = new HashMap<>();
for (Attribute amd : project.getMappingTarget(target).getTarget().getAtomicAttributes())
{
EntityType targetMetaData = RunAsSystemProxy.runAsSystem(() -> dataService.getEntityType(target));
attributeTagMap.put(amd.getName(),
newArrayList(ontologyTagService.getTagsForAttribute(targetMetaData, amd).values()));
}
return attributeTagMap;
}
private String getMappingServiceMenuUrl()
{
return menuReaderService.getMenu().findMenuItemPath(ID);
}
}
| lgpl-3.0 |
SirmaITT/conservation-space-1.7.0 | docker/sirma-platform/platform/seip-parent/platform/emf-semantic/emf-semantic-impl/src/test/java/com/sirma/itt/emf/mocks/search/SemanticLinkServiceMock.java | 1512 | /**
*
*/
package com.sirma.itt.emf.mocks.search;
import static org.mockito.Mockito.mock;
import java.util.Map;
import org.eclipse.rdf4j.repository.RepositoryConnection;
import com.sirma.itt.seip.util.ReflectionUtils;
import com.sirma.itt.emf.mocks.DefinitionServiceMock;
import com.sirma.itt.emf.mocks.NamespaceRegistryMock;
import com.sirma.itt.emf.semantic.persistence.SemanticLinkServiceImpl;
import com.sirma.itt.seip.event.EventService;
import com.sirma.itt.semantic.ConnectionFactory;
/**
* @author kirq4e
*/
public class SemanticLinkServiceMock extends SemanticLinkServiceImpl {
public SemanticLinkServiceMock(Map<String, Object> context) {
final ConnectionFactory connectionFactory = (ConnectionFactory) context.get("connectionFactory");
RepositoryConnection transactionalRepositoryConnection = connectionFactory.produceManagedConnection();
ReflectionUtils.setFieldValue(this, "repositoryConnection", transactionalRepositoryConnection);
ReflectionUtils.setFieldValue(this, "namespaceRegistryService", new NamespaceRegistryMock(context));
ReflectionUtils.setFieldValue(this, "valueFactory", connectionFactory.produceValueFactory());
ReflectionUtils.setFieldValue(this, "queryBuilder", new QueryBuilderMock(context));
ReflectionUtils.setFieldValue(this, "definitionService", new DefinitionServiceMock());
ReflectionUtils.setFieldValue(this, "eventService", mock(EventService.class));
// TODO init other services
// stateService
// readConverter
// writeConverter
}
}
| lgpl-3.0 |
robcowell/dynamicreports | dynamicreports-core/src/main/java/net/sf/dynamicreports/design/definition/expression/DRIDesignPropertyExpression.java | 1147 | /**
* DynamicReports - Free Java reporting library for creating reports dynamically
*
* Copyright (C) 2010 - 2012 Ricardo Mariaca
* http://dynamicreports.sourceforge.net
*
* This file is part of DynamicReports.
*
* DynamicReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DynamicReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DynamicReports. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.dynamicreports.design.definition.expression;
/**
* @author Ricardo Mariaca (dynamicreports@gmail.com)
*/
public interface DRIDesignPropertyExpression {
public String getName();
public DRIDesignExpression getValueExpression();
}
| lgpl-3.0 |
pmarches/jStellarAPI | src/main/java/jstellarapi/core/StellarPathSet.java | 120 | package jstellarapi.core;
import java.util.ArrayList;
public class StellarPathSet extends ArrayList<StellarPath> {
}
| lgpl-3.0 |
aocalderon/PhD | Y2Q2/Research/Code/SPMF/src/ca/pfv/spmf/gui/patternvizualizer/filters/FilterGreaterThanInteger.java | 2389 | package ca.pfv.spmf.gui.patternvizualizer.filters;
/*
* Copyright (c) 2008-2015 Philippe Fournier-Viger
*
* This file is part of the SPMF DATA MINING SOFTWARE
* (http://www.philippe-fournier-viger.com/spmf).
*
* SPMF is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, either version 3 of the License, or (at your option) any later
* version.
*
* SPMF 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
* SPMF. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* This class is a filter for selecting only patterns having an integer value no less than a given value.
*
* @author Philippe Fournier-Viger
*/
public class FilterGreaterThanInteger extends AbstractFilter{
/** the given value*/
int value;
/**
* Constructor
* @param value the given value
* @param columnName the colum the filter is applied to
* @param columnID the index of the column that the filter is applied to
*/
public FilterGreaterThanInteger(int value, String columnName, int columnID){
super(columnName, columnID);
this.value = value;
}
/**
* Get the name of this filter
* @return the name
*/
public static String getFilterGenericName() {
return " is no less than:";
}
/**
* Get a string representation of this filter including the given value and column name
* @return a string representation of the filter indicating the filter name, given value and column name.
*/
public String getFilterWithParameterName() {
return "\"" + getColumnName() + "\" >= " + value;
}
/**
* Abstract method to determine if an object should be kept according to the filter
* @param object the object
* @return true if the object should be kept. Otherwise, false.
*/
public boolean isKept(Object object) {
return ((Integer) object) >= value;
}
/**
* Get the Class that this filter is applicable to (e.g. Integer.class)
* @return a Class object
*/
static Class getApplicableClass() {
return Integer.class;
}
}
| lgpl-3.0 |
joansmith/sonarqube | server/sonar-server/src/main/java/org/sonar/server/computation/debt/DebtModelHolderImpl.java | 2798 | /*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.server.computation.debt;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkState;
import static java.util.Objects.requireNonNull;
public class DebtModelHolderImpl implements MutableDebtModelHolder {
private final List<Characteristic> rootCharacteristics = new ArrayList<>();
private final Map<Integer, Characteristic> characteristicById = new HashMap<>();
@Override
public DebtModelHolderImpl addCharacteristics(Characteristic rootCharacteristic, Iterable<? extends Characteristic> subCharacteristics) {
requireNonNull(rootCharacteristic, "rootCharacteristic cannot be null");
requireNonNull(subCharacteristics, "subCharacteristics cannot be null");
checkArgument(subCharacteristics.iterator().hasNext(), "subCharacteristics cannot be empty");
rootCharacteristics.add(rootCharacteristic);
characteristicById.put(rootCharacteristic.getId(), rootCharacteristic);
for (Characteristic characteristic : subCharacteristics) {
characteristicById.put(characteristic.getId(), characteristic);
}
return this;
}
@Override
public Characteristic getCharacteristicById(int id) {
checkInitialized();
Characteristic characteristic = characteristicById.get(id);
if (characteristic == null) {
throw new IllegalStateException("Debt characteristic with id [" + id + "] does not exist");
}
return characteristic;
}
@Override
public boolean hasCharacteristicById(int id) {
return characteristicById.get(id) != null;
}
@Override
public List<Characteristic> getRootCharacteristics() {
checkInitialized();
return rootCharacteristics;
}
private void checkInitialized() {
checkState(!characteristicById.isEmpty(), "Characteristics have not been initialized yet");
}
}
| lgpl-3.0 |
FoudroyantFactotum/The-Capricious-Production-Line-of-Wayward-Devices | src/main/java/mod/steamnsteel/structure/IStructure/IStructureSidedInventory.java | 575 | package mod.steamnsteel.structure.IStructure;
import mod.steamnsteel.structure.coordinates.TripleCoord;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
public interface IStructureSidedInventory extends ISidedInventory
{
boolean canStructureInsertItem(int slot, ItemStack item, EnumFacing side, TripleCoord blockID);
boolean canStructureExtractItem(int slot, ItemStack item, EnumFacing side, TripleCoord blockID);
int[] getSlotsForStructureFace(EnumFacing side, TripleCoord blockID);
}
| lgpl-3.0 |
hongliangpan/manydesigns.cn | trunk/elements/src/main/java/com/manydesigns/elements/options/SelectionProvider.java | 1615 | /*
* Copyright (C) 2005-2013 ManyDesigns srl. All rights reserved.
* http://www.manydesigns.com/
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package com.manydesigns.elements.options;
/*
* @author Paolo Predonzani - paolo.predonzani@manydesigns.com
* @author Angelo Lupo - angelo.lupo@manydesigns.com
* @author Giampiero Granatella - giampiero.granatella@manydesigns.com
* @author Alessio Stalla - alessio.stalla@manydesigns.com
*/
public interface SelectionProvider {
public static final String copyright =
"Copyright (c) 2005-2013, ManyDesigns srl";
String getName();
int getFieldCount();
DisplayMode getDisplayMode();
SearchDisplayMode getSearchDisplayMode();
SelectionModel createSelectionModel();
void ensureActive(Object... values);
String getCreateNewValueHref();
String getCreateNewValueText();
}
| lgpl-3.0 |
learn-postspectacular/ucp-porto-workshop-2010 | day2/src/olhares/day2/TwitterGraph.java | 6643 | /*
* This file is part of the TwitterGraph project, developed at day #2 @ the
* Olhares de Processing workshop at UCP Porto in July 2010.
*
* For more information about this example & (similar) workshop(s),
* please visit: http://learn.postspectacular.com/
*
* Copyright 2010 Karsten Schmidt (PostSpectacular Ltd.)
*
* TwitterGraph is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* TwitterGraph 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 TwitterGraph. If not, see <http://www.gnu.org/licenses/>.
*/
package olhares.day2;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.util.HashMap;
import processing.core.PApplet;
import toxi.data.feeds.AtomEntry;
import toxi.data.feeds.AtomFeed;
import toxi.geom.Rect;
import toxi.geom.Vec2D;
import toxi.physics2d.VerletParticle2D;
import toxi.physics2d.VerletPhysics2D;
import toxi.physics2d.VerletSpring2D;
public class TwitterGraph extends PApplet {
/**
* Search query for the live Twitter search API
*/
private static final String TWITTER_QUERY = "%23processing";
/**
* Filename of the local offline Twitter search results feed
*/
private static final String LOCAL_TWITTER_FEED = "twitter.xml";
/**
* Flag to indicate if to use live feed or local cache
*/
private boolean doUseLiveFeed = false;
/**
* Container element of the search results (loaded as Atom format)
*/
private AtomFeed feed;
/**
* A map to allow us to refer to authors using their names
*/
private HashMap<String, AuthorNode> authors = new HashMap<String, AuthorNode>();
/**
* Toxiclibs physics engine
*/
private VerletPhysics2D physics;
/**
* flag if node connections (springs between particles) should be rendered
*/
private boolean doShowLines;
/**
* Reference to node currently (if so) selected/rollover
*/
private GraphNode selectedNode;
/**
* Main entry point for application
*/
public static void main(String[] args) {
PApplet.main(new String[] { "olhares.day2.TwitterGraph" });
}
public void setup() {
size(1024, 768, OPENGL);
ellipseMode(RADIUS);
textFont(createFont("Serif", 10));
textAlign(CENTER, CENTER);
initPhysics();
initFeed();
}
public void draw() {
// update the physical simulation (causes animation of nodes)
physics.update();
background(222, 218, 218);
// move screen origin to center
translate(width / 2, height / 2);
// draw node connections if needed
if (doShowLines) {
stroke(0, 50);
for (VerletSpring2D s : physics.springs) {
line(s.a.x, s.a.y, s.b.x, s.b.y);
}
}
noStroke();
// render all authors and their associated message nodes
for (String name : authors.keySet()) {
authors.get(name).draw(g);
}
}
/**
* Loads the twitter data feed, then analyzes all entries and builds a graph
* of the extracted information.
*/
private void initFeed() {
if (doUseLiveFeed) {
// option 1: execute live twitter search using the Atom feed format
feed = AtomFeed
.newFromURL("http://search.twitter.com/search.atom?q="
+ TWITTER_QUERY);
} else {
// option 2: load locally cached search results
try {
feed = AtomFeed.newFromStream(new FileInputStream(
sketchPath(LOCAL_TWITTER_FEED)));
} catch (FileNotFoundException e) {
System.err.println("couldn't load xml file: "
+ LOCAL_TWITTER_FEED);
System.exit(1);
}
}
// check that feed is valid
if (feed != null) {
// clear map possibly containing existing authors
authors.clear();
// iterate over all feed entries (individual search results)
for (AtomEntry e : feed.entries) {
// create a new node for each entry and add as particle to
// physics simulation
EntryNode node = new EntryNode(e);
physics.addParticle(node);
// is author still unknown?
if (!authors.containsKey(e.author.name)) {
// create a new author node and store in map using his/her
// name as lookup key
AuthorNode author = new AuthorNode(node);
authors.put(e.author.name, author);
// also add to physics sim
physics.addParticle(author);
} else {
// add more entries to existing author
AuthorNode author = authors.get(e.author.name);
author.getEntries().add(node);
}
}
// create clusters for all authors,
// also connecting them with each other itself
for (String a : authors.keySet()) {
authors.get(a).createCluster(physics,
authors.values().iterator());
}
}
}
/**
* Initializes & configures the physics simulation space
*/
private void initPhysics() {
physics = new VerletPhysics2D();
physics.setWorldBounds(new Rect(-width / 2 + 100, -height / 2 + 100,
width - 200, height - 200));
physics.setDrag(0.9f);
}
public void keyPressed() {
switch (key) {
case 'l':
// toggle line drawing (true becomes false, false becomes true)
doShowLines = !doShowLines;
break;
case 'r':
initPhysics();
initFeed();
break;
}
}
/**
* Checks all nodes for rollover every time the mouse has been moved. A
* reference to a node which is active will be kept for use in
* {@link #mouseDragged()}
*/
public void mouseMoved() {
selectedNode = null;
// translate mouse position into same transformed space as used for
// rendering nodes.
Vec2D mousePos = new Vec2D(mouseX, mouseY).sub(width / 2, height / 2);
// then iterate over all particles (nodes) and check if point is matched
for (VerletParticle2D p : physics.particles) {
GraphNode node = (GraphNode) p;
if (selectedNode == null) {
GraphNode s = node.isMouseOver(mousePos);
// keep a reference to selected node
if (s != null) {
selectedNode = s;
}
} else if (node != selectedNode) {
node.clearRollover();
}
}
}
/**
* First checks if there's a selected node and if so moves it to the current
* mouse position (this works fine, because this node will always be locked
* (i.e. excluded from spring forces) when it is in the selected/rollover
* state.
*/
public void mouseDragged() {
if (selectedNode != null) {
Vec2D mousePos = new Vec2D(mouseX, mouseY).sub(width / 2,
height / 2);
selectedNode.set(mousePos);
}
}
} | lgpl-3.0 |
FenixEdu/fenixedu-academic | src/main/java/org/fenixedu/academic/ui/struts/action/manager/enrolments/EvaluationSeasonStatusTrackerRegisterBean.java | 4485 | /**
* Copyright © 2002 Instituto Superior Técnico
*
* This file is part of FenixEdu Academic.
*
* FenixEdu Academic is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* FenixEdu Academic is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with FenixEdu Academic. If not, see <http://www.gnu.org/licenses/>.
*/
package org.fenixedu.academic.ui.struts.action.manager.enrolments;
import java.io.Serializable;
import java.util.Comparator;
public class EvaluationSeasonStatusTrackerRegisterBean implements Serializable {
private static final long serialVersionUID = -7064883960750178974L;
public static final Comparator<EvaluationSeasonStatusTrackerRegisterBean> COMPARATOR_STUDENT_NUMBER =
new Comparator<EvaluationSeasonStatusTrackerRegisterBean>() {
@Override
public int compare(final EvaluationSeasonStatusTrackerRegisterBean es1,
final EvaluationSeasonStatusTrackerRegisterBean es2) {
final Integer studentNumber1 = es1.getStudentNumber();
final Integer studentNumber2 = es2.getStudentNumber();
return studentNumber1.compareTo(studentNumber2);
}
};
public static final Comparator<EvaluationSeasonStatusTrackerRegisterBean> COMPARATOR_STUDENT_NAME =
new Comparator<EvaluationSeasonStatusTrackerRegisterBean>() {
@Override
public int compare(final EvaluationSeasonStatusTrackerRegisterBean es1,
final EvaluationSeasonStatusTrackerRegisterBean es2) {
final String studentName1 = es1.getStudentName();
final String studentName2 = es2.getStudentName();
final int c = studentName1.compareTo(studentName2);
return c == 0 ? COMPARATOR_STUDENT_NUMBER.compare(es1, es2) : c;
}
};
public static final Comparator<EvaluationSeasonStatusTrackerRegisterBean> COMPARATOR_DEGREE =
new Comparator<EvaluationSeasonStatusTrackerRegisterBean>() {
@Override
public int compare(final EvaluationSeasonStatusTrackerRegisterBean es1,
final EvaluationSeasonStatusTrackerRegisterBean es2) {
final String degree1 = es1.getDegreeSigla();
final String degree2 = es2.getDegreeSigla();
final int c = degree1.compareTo(degree2);
return c == 0 ? COMPARATOR_STUDENT_NUMBER.compare(es1, es2) : c;
}
};
public static final Comparator<EvaluationSeasonStatusTrackerRegisterBean> COMPARATOR_COURSE =
new Comparator<EvaluationSeasonStatusTrackerRegisterBean>() {
@Override
public int compare(final EvaluationSeasonStatusTrackerRegisterBean es1,
final EvaluationSeasonStatusTrackerRegisterBean es2) {
final String course1 = es1.getCourseName();
final String course2 = es2.getCourseName();
final int c = course1.compareTo(course2);
return c == 0 ? COMPARATOR_STUDENT_NUMBER.compare(es1, es2) : c;
}
};
private Integer studentNumber;
private String studentName;
private String degreeSigla;
private String courseName;
public EvaluationSeasonStatusTrackerRegisterBean(Integer studentNumber, String studentName, String degreeSigla, String courseName) {
this.studentNumber = studentNumber;
this.studentName = studentName;
this.degreeSigla = degreeSigla;
this.courseName = courseName;
}
public Integer getStudentNumber() {
return studentNumber;
}
public String getStudentName() {
return studentName;
}
public String getDegreeSigla() {
return degreeSigla;
}
public String getCourseName() {
return courseName;
}
}
| lgpl-3.0 |
HOMlab/QN-ACTR-Release | QN-ACTR Java/src/jmt/gui/exact/table/PrototypedTableModel.java | 1269 | /**
* Copyright (C) 2006, Laboratorio di Valutazione delle Prestazioni - Politecnico di Milano
* 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
package jmt.gui.exact.table;
/**
* @author alyf (Andrea Conti)
* Date: 16-set-2003
* Time: 12.26.57
*/
/**
* This interface identifies TableModels that can supply maximum-length prototypes of
* column data.
*/
public interface PrototypedTableModel {
/**
* @return a prototypical data item for column i. This is typically a maximum-length item used for autmatically sizing columns.
*/
public Object getPrototype(int i);
}
| lgpl-3.0 |
denarie/Portofino | elements/src/main/java/com/manydesigns/elements/annotations/impl/RegExpImpl.java | 1919 | /*
* Copyright (C) 2005-2017 ManyDesigns srl. All rights reserved.
* http://www.manydesigns.com/
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package com.manydesigns.elements.annotations.impl;
import com.manydesigns.elements.annotations.RegExp;
import java.lang.annotation.Annotation;
/*
* @author Paolo Predonzani - paolo.predonzani@manydesigns.com
* @author Angelo Lupo - angelo.lupo@manydesigns.com
* @author Giampiero Granatella - giampiero.granatella@manydesigns.com
* @author Alessio Stalla - alessio.stalla@manydesigns.com
*/
@SuppressWarnings({"ClassExplicitlyAnnotation"})
public class RegExpImpl implements RegExp {
public static final String copyright =
"Copyright (C) 2005-2017 ManyDesigns srl";
private final String value;
private final String errorMessage;
public RegExpImpl(String value, String errorMessage) {
this.value = value;
this.errorMessage = errorMessage;
}
public String value() {
return value;
}
public String errorMessage() {
return errorMessage;
}
public Class<? extends Annotation> annotationType() {
return RegExp.class;
}
}
| lgpl-3.0 |
covers1624/LegacyFarms | src/main/java/covers1624/legacyfarms/container/ContainerArboretum.java | 2849 | package covers1624.legacyfarms.container;
import covers1624.legacyfarms.init.ForestryProxy;
import covers1624.legacyfarms.init.ModBlocks;
import covers1624.legacyfarms.slot.InputSlot;
import covers1624.legacyfarms.slot.OutputSlot;
import covers1624.legacyfarms.tile.planter.TilePlanter;
import covers1624.lib.inventory.InventoryUtils;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.ArrayList;
public class ContainerArboretum extends Container {
private TilePlanter arboretum;
private static ArrayList<ItemStack> saplings = OreDictionary.getOres("treeSapling");
public ContainerArboretum(InventoryPlayer playerInventory, TilePlanter arboretum) {
this.arboretum = arboretum;
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 0, 19, 35, new ItemStack(ForestryProxy.soil)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 1, 37, 35, new ItemStack(ForestryProxy.soil)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 2, 19, 53, new ItemStack(ForestryProxy.soil)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 3, 37, 53, new ItemStack(ForestryProxy.soil)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 4, 71, 35, new ItemStack(ModBlocks.blockSapling)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 5, 89, 35, new ItemStack(ModBlocks.blockSapling)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 6, 71, 53, new ItemStack(ModBlocks.blockSapling)));
InventoryUtils.addSlotToContainer(this, new InputSlot(arboretum, 7, 89, 53, new ItemStack(ModBlocks.blockSapling)));
InventoryUtils.addSlotToContainer(this, new OutputSlot(arboretum, 8, 123, 35));
InventoryUtils.addSlotToContainer(this, new OutputSlot(arboretum, 9, 141, 35));
InventoryUtils.addSlotToContainer(this, new OutputSlot(arboretum, 10, 123, 53));
InventoryUtils.addSlotToContainer(this, new OutputSlot(arboretum, 11, 141, 53));
InventoryUtils.bindPlayerInventory(this, playerInventory, 8, 84);
//int var3;
//for (var3 = 0; var3 < 3; ++var3) {
// for (int var4 = 0; var4 < 9; ++var4) {
// addSlotToContainer(new Slot(playerInventory, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18));
// }
//}
//
//for (var3 = 0; var3 < 9; ++var3) {
// addSlotToContainer(new Slot(playerInventory, var3, 8 + var3 * 18, 142));
//}
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return this.arboretum.isUseableByPlayer(player);
}
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) {
return InventoryUtils.transferStackInSlot(this, player, slotIndex);
}
}
| lgpl-3.0 |
xinghuangxu/xinghuangxu.sonarqube | plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/widgets/TechnicalDebtPyramidWidget.java | 1305 | /*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2013 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.plugins.core.widgets;
import org.sonar.api.web.UserRole;
import org.sonar.api.web.WidgetCategory;
@UserRole(UserRole.USER)
@WidgetCategory("Technical Debt")
public final class TechnicalDebtPyramidWidget extends CoreWidget {
public TechnicalDebtPyramidWidget() {
super("technical_debt_pyramid", "Technical Debt Pyramid", "/org/sonar/plugins/core/widgets/technical_debt_pyramid.html.erb");
}
}
| lgpl-3.0 |
dana-i2cat/opennaas-routing-nfv | extensions/bundles/ofertie.ncl/src/main/java/org/opennaas/extensions/ofertie/ncl/provisioner/api/exceptions/FlowAllocationException.java | 657 | package org.opennaas.extensions.ofertie.ncl.provisioner.api.exceptions;
/**
* An exception there have been an error allocating a flow.
*
* @author Isart Canyameres Gimenez (i2cat)
*
*/
public class FlowAllocationException extends Exception {
/**
* Auto-generated serial number.
*/
private static final long serialVersionUID = -7959827367903826425L;
public FlowAllocationException() {
super();
}
public FlowAllocationException(String message, Throwable cause) {
super(message, cause);
}
public FlowAllocationException(String message) {
super(message);
}
public FlowAllocationException(Throwable cause) {
super(cause);
}
}
| lgpl-3.0 |
since2014/Rsync | src/com/ktereyp/rsync/ui/listener/DeleteRemoteDeviceListener.java | 184 | package com.ktereyp.rsync.ui.listener;
import com.ktereyp.rsync.utils.RemoteDevice;
public interface DeleteRemoteDeviceListener {
public void deleteRemoteDevice(RemoteDevice rd);
}
| lgpl-3.0 |
OpenSoftwareSolutions/PDFReporter-Studio | com.jaspersoft.studio.data/src/com/jaspersoft/studio/data/xml/XMLQueryEditorPreferencePage.java | 2078 | /*******************************************************************************
* Copyright (C) 2005 - 2014 TIBCO Software Inc. All rights reserved.
* http://www.jaspersoft.com.
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
******************************************************************************/
package com.jaspersoft.studio.data.xml;
import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.ui.IWorkbench;
import com.jaspersoft.studio.JaspersoftStudioPlugin;
import com.jaspersoft.studio.data.messages.Messages;
import com.jaspersoft.studio.preferences.util.FieldEditorOverlayPage;
/**
* XML query editor preference page.
*
* @author Massimo Rabbi (mrabbi@users.sourceforge.net)
*
*/
public class XMLQueryEditorPreferencePage extends FieldEditorOverlayPage {
public static final String P_USE_RECURSIVE_RETRIEVAL = "xmlChildrenRecursiveRetrieval";//$NON-NLS-1$
public static final String PAGE_ID = "com.jaspersoft.studio.data.preferences.XMLQueryEditorPreferencePage.property"; //$NON-NLS-1$
public XMLQueryEditorPreferencePage() {
super(GRID);
setPreferenceStore(JaspersoftStudioPlugin.getInstance().getPreferenceStore());
setDescription(Messages.XMLQueryEditorPreferencePage_Description);
}
@Override
public void init(IWorkbench workbench) {
}
@Override
protected String getPageId() {
return PAGE_ID;
}
@Override
protected void createFieldEditors() {
addField(new BooleanFieldEditor(P_USE_RECURSIVE_RETRIEVAL,
Messages.XMLQueryEditorPreferencePage_RecursiveReadFields, getFieldEditorParent()));
}
public static void getDefaults(IPreferenceStore store) {
store.setDefault(P_USE_RECURSIVE_RETRIEVAL, new Boolean(false)); //$//$NON-NLS-1$
}
}
| lgpl-3.0 |
angrymasteryoda/cis-18b | canceled-project/src/engine/DisplayManger.java | 854 | package engine;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.*;
/**
* Created with IntelliJ IDEA.
* User: Michael Risher
* Date: 2/27/15
* Time: 6:23 PM
*/
public class DisplayManger {
private static int width = 1280;
private static int height = 720;
private static int fpsCap = 120;
public static void createDisplay(){
ContextAttribs attribs = new ContextAttribs( 3,2 );
attribs.withForwardCompatible( true );
attribs.withProfileCore( true );
try {
Display.setDisplayMode( new DisplayMode( width, height ) );
Display.create( new PixelFormat( ), attribs );
} catch ( LWJGLException e ) {
e.printStackTrace();
}
GL11.glViewport( 0, 0, width, height );
}
public static void updateDisplay(){
Display.sync( fpsCap );
Display.update();
}
public static void closeDisplay(){
Display.destroy();
}
}
| lgpl-3.0 |
dieudonne-willems/om-java-libs | OM-java-core-set/src/main/java/nl/wur/fbr/om/core/set/quantities/magnetism/package-info.java | 162 | /**
* This package contains the core set of Magnetism quantities.
*
* @author Don Willems on 05/10/15.
*/
package nl.wur.fbr.om.core.set.quantities.magnetism; | lgpl-3.0 |
salmuz/graphz | sources/project-graphz-view/graphz-mvp/src/main/java/org/salmuz/graphz/mvp/view/UINewGraph.java | 9521 | /* ==========================================
* Cross-Platform-GraphZ : a free Java graph-theory library
* ==========================================
*
* salmuz : Carranza Alarcon Yonatan Carlos
*
* (C) Copyright 2013, by salmuz and Contributors.
*
* Project Info: https://github.com/salmuz/Cross-Platform-GraphZ
* Project Creator: salmuz (https://www.assembla.com/spaces/salmuz-java)
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation,
* Inc.,
*
* ------------------
* Point.java
* ------------------
* (C) Copyright 2013, by salmuz and Contributors
*
* Original Author: Carranza Alarcon Yonatan Carlos
* Contributor(s): Coz Velasquez Antonio
* Kalil DAHER MOHAMED
* Aben Nouh Abdirazak
*
* Changes
* -------
* 12/02/13 : Version 01;
*
*/
package org.salmuz.graphz.mvp.view;
import org.salmuz.graphz.mvp.common.View;
import javax.swing.*;
public class UINewGraph extends javax.swing.JDialog implements View {
/**
* Creates new form UINewGraph
*/
public UINewGraph(java.awt.Frame parent, boolean modal) {
super(parent, modal);
initComponents();
}
// <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
private void initComponents() {
bgGraphe = new javax.swing.ButtonGroup();
jPanel1 = new javax.swing.JPanel();
jrbOriente = new javax.swing.JRadioButton();
jrbNetwork = new javax.swing.JRadioButton();
jrbNonOriente = new javax.swing.JRadioButton();
jPanel2 = new javax.swing.JPanel();
btnAcepter = new javax.swing.JButton();
btnCanceler = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("Choisir de type de Graphe"));
jrbOriente.setText("Graphe Oriente");
jrbOriente.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jrbOriente.setMargin(new java.awt.Insets(0, 0, 0, 0));
bgGraphe.add(jrbOriente);
jrbNetwork.setText("Graphe Network");
jrbNetwork.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jrbNetwork.setMargin(new java.awt.Insets(0, 0, 0, 0));
bgGraphe.add(jrbNetwork);
jrbNonOriente.setText("Graphe Non Oriente");
jrbNonOriente.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
jrbNonOriente.setMargin(new java.awt.Insets(0, 0, 0, 0));
bgGraphe.add(jrbNonOriente);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(22, 22, 22)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jrbNonOriente)
.addComponent(jrbOriente)
.addComponent(jrbNetwork))
.addContainerGap(75, Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jrbOriente)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jrbNetwork)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jrbNonOriente)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
btnAcepter.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/salmuz/graphz/mvp/image/acepter.png")));
btnAcepter.setText("Accepter");
btnCanceler.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/salmuz/graphz/mvp/image/cancel.png")));
btnCanceler.setText("Annuler");
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btnAcepter)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnCanceler)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(btnAcepter)
.addComponent(btnCanceler))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
public ButtonGroup getBgGraphe() {
return bgGraphe;
}
public void setBgGraphe(ButtonGroup bgGraphe) {
this.bgGraphe = bgGraphe;
}
public JButton getBtnAcepter() {
return btnAcepter;
}
public void setBtnAcepter(JButton btnAcepter) {
this.btnAcepter = btnAcepter;
}
public JButton getBtnCanceler() {
return btnCanceler;
}
public void setBtnCanceler(JButton btnCanceler) {
this.btnCanceler = btnCanceler;
}
public JRadioButton getJrbOriente() {
return jrbOriente;
}
public void setJrbOriente(JRadioButton jrbOriente) {
this.jrbOriente = jrbOriente;
}
public JRadioButton getJrbNonOriente() {
return jrbNonOriente;
}
public void setJrbNonOriente(JRadioButton jrbNonOriente) {
this.jrbNonOriente = jrbNonOriente;
}
public JRadioButton getJrbNetwork() {
return jrbNetwork;
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.ButtonGroup bgGraphe;
private javax.swing.JButton btnAcepter;
private javax.swing.JButton btnCanceler;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JRadioButton jrbOriente;
private javax.swing.JRadioButton jrbNonOriente;
private javax.swing.JRadioButton jrbNetwork;
// End of variables declaration//GEN-END:variables
}
| lgpl-3.0 |
Jiten-Patel/Chronicle-Engine | src/main/java/net/openhft/chronicle/engine/api/Updatable.java | 2177 | /*
* Copyright (C) 2015 higherfrequencytrading.com
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.openhft.chronicle.engine.api;
import net.openhft.chronicle.core.util.SerializableBiFunction;
import net.openhft.chronicle.core.util.SerializableFunction;
import net.openhft.chronicle.core.util.SerializableUpdater;
import net.openhft.chronicle.core.util.SerializableUpdaterWithArg;
import org.jetbrains.annotations.NotNull;
/**
* Created by peter on 22/06/15.
*/
public interface Updatable<E> {
default <R> R apply(@NotNull SerializableFunction<E, R> function) {
return function.apply((E) this);
}
default void asyncUpdate(@NotNull SerializableUpdater<E> updateFunction) {
updateFunction.accept((E) this);
}
default <R> R syncUpdate(@NotNull SerializableUpdater<E> updateFunction, @NotNull SerializableFunction<E, R> returnFunction) {
updateFunction.accept((E) this);
return returnFunction.apply((E) this);
}
default <A, R> R apply(@NotNull SerializableBiFunction<E, A, R> function, A arg) {
return function.apply((E) this, arg);
}
default <A> void asyncUpdate(@NotNull SerializableUpdaterWithArg<E, A> updateFunction, A arg) {
updateFunction.accept((E) this, arg);
}
default <UA, RA, R> R syncUpdate(@NotNull SerializableUpdaterWithArg<E, UA> updateFunction, UA ua, @NotNull SerializableBiFunction<E, RA, R> returnFunction, RA ra) {
updateFunction.accept((E) this, ua);
return returnFunction.apply((E) this, ra);
}
}
| lgpl-3.0 |
SMASH-Lab/SEE-HLA-Starter-Kit | src/skf/model/AbstractClassEntity.java | 1553 | /*****************************************************************
SEE HLA Starter Kit - A Java framework to develop HLA Federates
in the context of the SEE (Simulation Exploration Experience)
project.
Copyright (c) 2014, SMASH Lab - University of Calabria (Italy),
All rights reserved.
GNU Lesser General Public License (GNU LGPL).
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3.0 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library.
If not, see http://http://www.gnu.org/licenses/
*****************************************************************/
package skf.model;
public abstract class AbstractClassEntity {
protected String instanceName = null;
protected Object element = null;
public AbstractClassEntity(Object element) {
this.element = element;
}
public String getInstanceName() {
return this.instanceName;
}
public Object getElement() {
return element;
}
public void setElement(Object element) {
this.element = element;
}
public void setInstanceName(String instanceName) {
this.instanceName = instanceName;
}
}
| lgpl-3.0 |
OpenSoftwareSolutions/PDFReporter | pdfreporter-ios/src/org/oss/pdfreporter/font/FontFactory.java | 970 | /*******************************************************************************
* Copyright (c) 2013 Open Software Solutions GmbH.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Public License v3.0
* which accompanies this distribution, and is available at
* http://www.gnu.org/licenses/gpl.html
*
* Contributors:
* Open Software Solutions GmbH - initial API and implementation
******************************************************************************/
package org.oss.pdfreporter.font;
import org.oss.pdfreporter.registry.ApiRegistry;
public class FontFactory extends FontFactoryBase {
public static void registerFactory() {
ApiRegistry.register(new FontFactory());
}
private final IFontManager fontManager;
private FontFactory() {
super();
this.fontManager = new FontManager();
}
@Override
public IFontManager getFontManager() {
return fontManager;
}
}
| lgpl-3.0 |
robcowell/dynamicreports | dynamicreports-core/src/main/java/net/sf/dynamicreports/report/base/style/DRPen.java | 2139 | /**
* DynamicReports - Free Java reporting library for creating reports dynamically
*
* Copyright (C) 2010 - 2012 Ricardo Mariaca
* http://dynamicreports.sourceforge.net
*
* This file is part of DynamicReports.
*
* DynamicReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DynamicReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with DynamicReports. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.dynamicreports.report.base.style;
import java.awt.Color;
import net.sf.dynamicreports.report.constant.Constants;
import net.sf.dynamicreports.report.constant.LineStyle;
import net.sf.dynamicreports.report.definition.style.DRIPen;
import org.apache.commons.lang3.Validate;
/**
* @author Ricardo Mariaca (dynamicreports@gmail.com)
*/
public class DRPen implements DRIPen {
private static final long serialVersionUID = Constants.SERIAL_VERSION_UID;
private Float lineWidth;
private LineStyle lineStyle;
private Color lineColor;
public DRPen() {
}
public DRPen(Float lineWidth, LineStyle lineStyle) {
this.setLineWidth(lineWidth);
this.lineStyle = lineStyle;
}
@Override
public Float getLineWidth() {
return lineWidth;
}
public void setLineWidth(Float lineWidth) {
if (lineWidth != null) {
Validate.isTrue(lineWidth >= 0, "lineWidth must be >= 0");
}
this.lineWidth = lineWidth;
}
@Override
public LineStyle getLineStyle() {
return lineStyle;
}
public void setLineStyle(LineStyle lineStyle) {
this.lineStyle = lineStyle;
}
@Override
public Color getLineColor() {
return lineColor;
}
public void setLineColor(Color lineColor) {
this.lineColor = lineColor;
}
}
| lgpl-3.0 |
SafetyCulture/DroidText | app/src/main/java/bouncycastle/repack/org/bouncycastle/asn1/x509/Target.java | 3281 | package repack.org.bouncycastle.asn1.x509;
import repack.org.bouncycastle.asn1.ASN1Choice;
import repack.org.bouncycastle.asn1.ASN1Encodable;
import repack.org.bouncycastle.asn1.ASN1TaggedObject;
import repack.org.bouncycastle.asn1.DERObject;
import repack.org.bouncycastle.asn1.DERTaggedObject;
/**
* Target structure used in target information extension for attribute
* certificates from RFC 3281.
* <p/>
* <pre>
* Target ::= CHOICE {
* targetName [0] GeneralName,
* targetGroup [1] GeneralName,
* targetCert [2] TargetCert
* }
* </pre>
* <p/>
* <p/>
* The targetCert field is currently not supported and must not be used
* according to RFC 3281.
*/
public class Target
extends ASN1Encodable
implements ASN1Choice
{
public static final int targetName = 0;
public static final int targetGroup = 1;
private GeneralName targName;
private GeneralName targGroup;
/**
* Creates an instance of a Target from the given object.
* <p/>
* <code>obj</code> can be a Target or a {@link ASN1TaggedObject}
*
* @param obj The object.
* @return A Target instance.
* @throws IllegalArgumentException if the given object cannot be
* interpreted as Target.
*/
public static Target getInstance(Object obj)
{
if(obj instanceof Target)
{
return (Target) obj;
}
else if(obj instanceof ASN1TaggedObject)
{
return new Target((ASN1TaggedObject) obj);
}
throw new IllegalArgumentException("unknown object in factory: "
+ obj.getClass());
}
/**
* Constructor from ASN1TaggedObject.
*
* @param tagObj The tagged object.
* @throws IllegalArgumentException if the encoding is wrong.
*/
private Target(ASN1TaggedObject tagObj)
{
switch(tagObj.getTagNo())
{
case targetName: // GeneralName is already a choice so explicit
targName = GeneralName.getInstance(tagObj, true);
break;
case targetGroup:
targGroup = GeneralName.getInstance(tagObj, true);
break;
default:
throw new IllegalArgumentException("unknown tag: " + tagObj.getTagNo());
}
}
/**
* Constructor from given details.
* <p/>
* Exactly one of the parameters must be not <code>null</code>.
*
* @param type the choice type to apply to the name.
* @param name the general name.
* @throws IllegalArgumentException if type is invalid.
*/
public Target(int type, GeneralName name)
{
this(new DERTaggedObject(type, name));
}
/**
* @return Returns the targetGroup.
*/
public GeneralName getTargetGroup()
{
return targGroup;
}
/**
* @return Returns the targetName.
*/
public GeneralName getTargetName()
{
return targName;
}
/**
* Produce an object suitable for an ASN1OutputStream.
* <p/>
* Returns:
* <p/>
* <pre>
* Target ::= CHOICE {
* targetName [0] GeneralName,
* targetGroup [1] GeneralName,
* targetCert [2] TargetCert
* }
* </pre>
*
* @return a DERObject
*/
public DERObject toASN1Object()
{
// GeneralName is a choice already so most be explicitly tagged
if(targName != null)
{
return new DERTaggedObject(true, 0, targName);
}
else
{
return new DERTaggedObject(true, 1, targGroup);
}
}
}
| lgpl-3.0 |
rmage/gnvc-ims | stratchpad/org/apache/poi/hdf/model/hdftypes/TableCellDescriptor.java | 2785 | /* ====================================================================
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.poi.hdf.model.hdftypes;
import org.apache.poi.hdf.model.hdftypes.definitions.TCAbstractType;
import org.apache.poi.util.LittleEndian;
/**
* Comment me
*
* @author Ryan Ackley
*/
@Deprecated
public final class TableCellDescriptor extends TCAbstractType implements HDFType
{
/*boolean _fFirstMerged;
boolean _fMerged;
boolean _fVertical;
boolean _fBackward;
boolean _fRotateFont;
boolean _fVertMerge;
boolean _fVertRestart;
short _vertAlign;
short[] _brcTop = new short[2];
short[] _brcLeft = new short[2];
short[] _brcBottom = new short[2];
short[] _brcRight = new short [2];*/
public TableCellDescriptor()
{
}
static TableCellDescriptor convertBytesToTC(byte[] array, int offset)
{
TableCellDescriptor tc = new TableCellDescriptor();
int rgf = LittleEndian.getShort(array, offset);
tc.setFFirstMerged((rgf & 0x0001) > 0);
tc.setFMerged((rgf & 0x0002) > 0);
tc.setFVertical((rgf & 0x0004) > 0);
tc.setFBackward((rgf & 0x0008) > 0);
tc.setFRotateFont((rgf & 0x0010) > 0);
tc.setFVertMerge((rgf & 0x0020) > 0);
tc.setFVertRestart((rgf & 0x0040) > 0);
tc.setVertAlign((byte)((rgf & 0x0180) >> 7));
short[] brcTop = new short[2];
short[] brcLeft = new short[2];
short[] brcBottom = new short[2];
short[] brcRight = new short[2];
brcTop[0] = LittleEndian.getShort(array, offset + 4);
brcTop[1] = LittleEndian.getShort(array, offset + 6);
brcLeft[0] = LittleEndian.getShort(array, offset + 8);
brcLeft[1] = LittleEndian.getShort(array, offset + 10);
brcBottom[0] = LittleEndian.getShort(array, offset + 12);
brcBottom[1] = LittleEndian.getShort(array, offset + 14);
brcRight[0] = LittleEndian.getShort(array, offset + 16);
brcRight[1] = LittleEndian.getShort(array, offset + 18);
return tc;
}
}
| lgpl-3.0 |
XzeroAir/Trinkets-1.12.2 | main/java/xzeroair/trinkets/client/events/CameraHandler.java | 5271 | package xzeroair.trinkets.client.events;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.client.event.EntityViewRenderEvent.CameraSetup;
import net.minecraftforge.client.event.FOVUpdateEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
public class CameraHandler {
private static Minecraft mc = Minecraft.getMinecraft();
private double getVanillaTranslation(double partialTicks, EntityPlayer player) {
final float f = player.getEyeHeight();
final double d0 = player.prevPosX + ((player.posX - player.prevPosX) * partialTicks);
final double d1 = player.prevPosY + ((player.posY - player.prevPosY) * partialTicks) + (f);
final double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * partialTicks);
double d3 = 4 + (0 * partialTicks);
final float f1 = player.rotationYaw;
float f2 = player.rotationPitch;
if (mc.gameSettings.thirdPersonView == 2)
{
f2 += 180.0F;
}
final float sq = 0.017453292F;
final double d4 = -MathHelper.sin(f1 * sq) * MathHelper.cos(f2 * sq) * d3;
final double d5 = MathHelper.cos(f1 * sq) * MathHelper.cos(f2 * sq) * d3;
final double d6 = (-MathHelper.sin(f2 * sq)) * d3;
for (int i = 0; i < 8; ++i)
{
float f3 = ((i & 1) * 2) - 1;
float f4 = (((i >> 1) & 1) * 2) - 1;
float f5 = (((i >> 2) & 1) * 2) - 1;
f3 = f3 * 0.1F;
f4 = f4 * 0.1F;
f5 = f5 * 0.1F;
final double startX = d0 + f3;
final double startY = (d1 + f4);
final double startZ = d2 + f5;
final Vec3d start = new Vec3d(startX, startY , startZ);
final double endX = ((d0 - d4) + f3 + f5);
final double endY = ((d1 - d6) + f4);
final double endZ = ((d2 - d5) + f5);
final Vec3d end = new Vec3d(endX, endY, endZ);
final RayTraceResult raytraceresult = mc.world.rayTraceBlocks(start, end);
if (raytraceresult != null) {
final double d7 = raytraceresult.hitVec.distanceTo(new Vec3d(d0, d1, d2));
if (d7 < d3) {
d3 = d7;
}
}
}
return d3;
}
private double getAdjustedTranslation(double partialTicks, EntityPlayer player) {
final float f = player.getEyeHeight();
final double d0 = player.prevPosX + ((player.posX - player.prevPosX) * partialTicks);
final double d1 = player.prevPosY + ((player.posY - player.prevPosY) * partialTicks) + (f);
final double d2 = player.prevPosZ + ((player.posZ - player.prevPosZ) * partialTicks);
double d3 = 1 + (0 * partialTicks);
final float f1 = player.rotationYaw;
float f2 = player.rotationPitch;
if (mc.gameSettings.thirdPersonView == 2)
{
f2 += 180.0F;
}
final float sq = 0.017453292F*1F;
final double d4 = -MathHelper.sin(f1 * sq) * MathHelper.cos(f2 * sq) * d3;
final double d5 = MathHelper.cos(f1 * sq) * MathHelper.cos(f2 * sq) * d3;
final double d6 = (-MathHelper.sin(f2 * sq)) * d3;
for (int i = 0; i < 8; ++i)
{
float f3 = ((i & 1) * 2) - 1;
float f4 = (((i >> 1) & 1) * 2) - 1;
float f5 = (((i >> 2) & 1) * 2) - 1;
f3 = f3 * 0.1F;
f4 = f4 * 0.1F;
f5 = f5 * 0.1F;
final double startX = d0 + f3;
final double startY = (d1 + f4);
final double startZ = d2 + f5;
final Vec3d start = new Vec3d(startX, startY , startZ);
final double endX = ((d0 - d4));
final double endY = ((d1 - d6));
final double endZ = ((d2 - (d5)));
final Vec3d end = new Vec3d(endX, endY, endZ);
final RayTraceResult raytraceresult = mc.world.rayTraceBlocks(start, end);
if (raytraceresult != null) {
final double d7 = raytraceresult.hitVec.distanceTo(new Vec3d(d0, d1, d2));
if (d7 < d3) {
d3 = d7*0.9;
}
}
}
return d3;
}
@SubscribeEvent
public void CameraSetup(CameraSetup event) {
// final EntityPlayer player = Minecraft.getMinecraft().player;
// final ISizeCap cap = player.getCapability(SizeCapPro.sizeCapability, null);
// if (cap != null) {
// final int currentView = Minecraft.getMinecraft().gameSettings.thirdPersonView;
// final double mcTL = getVanillaTranslation(event.getRenderPartialTicks(), player);
// final double adTL = getAdjustedTranslation(event.getRenderPartialTicks(), player);
// }
}
@SubscribeEvent
public void FOVUpdate(FOVUpdateEvent event){
// if(event.getEntity() != null) {
// final EntityPlayer player = event.getEntity();
// final ISizeCap cap = player.getCapability(SizeCapPro.sizeCapability, null);
// if((cap != null)) {
// if((TrinketHelper.AccessoryCheck(player, ModItems.trinkets.TrinketFairyRing) || cap.getFood().contentEquals("fairy_dew")) && !TrinketHelper.AccessoryCheck(player, ModItems.trinkets.TrinketDwarfRing)) {
// if(mc.gameSettings.thirdPersonView > 0) {
// event.setNewfov((event.getFov() / 90.0f) * 60.0f);
// }
// }
// if(TrinketHelper.AccessoryCheck(player, ModItems.trinkets.TrinketTitanRing)) {
// System.out.println((event.getFov() / 60.0f) * 180.0f);
// event.setNewfov((event.getFov() / 90.0f) * 180.0f);
// }
// }
// }
}
}
| lgpl-3.0 |
MastekLtd/JBEAM | jbeam-core-components/jbeam-monitor-services/src/main/java/com/stgmastek/monitor/services/client/ConfigParameter.java | 15062 | /*
* Copyright (c) 2014 Mastek Ltd. All rights reserved.
*
* This file is part of JBEAM. JBEAM is free software: you can
* redistribute it and/or modify it under the terms of the GNU Lesser
* General Public License as published by the Free Software Foundation.
*
* JBEAM is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for the specific language governing permissions and
* limitations.
*
* You should have received a copy of the GNU Lesser General Public
* License along with JBEAM. If not, see <http://www.gnu.org/licenses/>.
*/
package com.stgmastek.monitor.services.client;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import javax.xml.datatype.XMLGregorianCalendar;
/**
* <p>Java class for configParameter complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="configParameter">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="charValue" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue2" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue3" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue4" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue5" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue6" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue7" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="charValue8" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="createdBy" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="dateValue" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="excludeAllOption" type="{http://www.w3.org/2001/XMLSchema}boolean" minOccurs="0"/>
* <element name="masterCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="modifiedBy" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="modifiedDate" type="{http://www.w3.org/2001/XMLSchema}dateTime" minOccurs="0"/>
* <element name="numericValue" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
* <element name="orderNo" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="parentId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="subCode" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="zeeValueCheck" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "configParameter", propOrder = {
"charValue",
"charValue2",
"charValue3",
"charValue4",
"charValue5",
"charValue6",
"charValue7",
"charValue8",
"createdBy",
"dateValue",
"description",
"excludeAllOption",
"masterCode",
"modifiedBy",
"modifiedDate",
"numericValue",
"orderNo",
"parentId",
"subCode",
"zeeValueCheck"
})
public class ConfigParameter {
protected String charValue;
protected String charValue2;
protected String charValue3;
protected String charValue4;
protected String charValue5;
protected String charValue6;
protected String charValue7;
protected String charValue8;
protected String createdBy;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar dateValue;
protected String description;
protected Boolean excludeAllOption;
protected String masterCode;
protected String modifiedBy;
@XmlSchemaType(name = "dateTime")
protected XMLGregorianCalendar modifiedDate;
protected Integer numericValue;
protected String orderNo;
protected String parentId;
protected String subCode;
protected String zeeValueCheck;
/**
* Gets the value of the charValue property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue() {
return charValue;
}
/**
* Sets the value of the charValue property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue(String value) {
this.charValue = value;
}
/**
* Gets the value of the charValue2 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue2() {
return charValue2;
}
/**
* Sets the value of the charValue2 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue2(String value) {
this.charValue2 = value;
}
/**
* Gets the value of the charValue3 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue3() {
return charValue3;
}
/**
* Sets the value of the charValue3 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue3(String value) {
this.charValue3 = value;
}
/**
* Gets the value of the charValue4 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue4() {
return charValue4;
}
/**
* Sets the value of the charValue4 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue4(String value) {
this.charValue4 = value;
}
/**
* Gets the value of the charValue5 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue5() {
return charValue5;
}
/**
* Sets the value of the charValue5 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue5(String value) {
this.charValue5 = value;
}
/**
* Gets the value of the charValue6 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue6() {
return charValue6;
}
/**
* Sets the value of the charValue6 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue6(String value) {
this.charValue6 = value;
}
/**
* Gets the value of the charValue7 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue7() {
return charValue7;
}
/**
* Sets the value of the charValue7 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue7(String value) {
this.charValue7 = value;
}
/**
* Gets the value of the charValue8 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCharValue8() {
return charValue8;
}
/**
* Sets the value of the charValue8 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCharValue8(String value) {
this.charValue8 = value;
}
/**
* Gets the value of the createdBy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getCreatedBy() {
return createdBy;
}
/**
* Sets the value of the createdBy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setCreatedBy(String value) {
this.createdBy = value;
}
/**
* Gets the value of the dateValue property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getDateValue() {
return dateValue;
}
/**
* Sets the value of the dateValue property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setDateValue(XMLGregorianCalendar value) {
this.dateValue = value;
}
/**
* Gets the value of the description property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getDescription() {
return description;
}
/**
* Sets the value of the description property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setDescription(String value) {
this.description = value;
}
/**
* Gets the value of the excludeAllOption property.
*
* @return
* possible object is
* {@link Boolean }
*
*/
public Boolean isExcludeAllOption() {
return excludeAllOption;
}
/**
* Sets the value of the excludeAllOption property.
*
* @param value
* allowed object is
* {@link Boolean }
*
*/
public void setExcludeAllOption(Boolean value) {
this.excludeAllOption = value;
}
/**
* Gets the value of the masterCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getMasterCode() {
return masterCode;
}
/**
* Sets the value of the masterCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setMasterCode(String value) {
this.masterCode = value;
}
/**
* Gets the value of the modifiedBy property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getModifiedBy() {
return modifiedBy;
}
/**
* Sets the value of the modifiedBy property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setModifiedBy(String value) {
this.modifiedBy = value;
}
/**
* Gets the value of the modifiedDate property.
*
* @return
* possible object is
* {@link XMLGregorianCalendar }
*
*/
public XMLGregorianCalendar getModifiedDate() {
return modifiedDate;
}
/**
* Sets the value of the modifiedDate property.
*
* @param value
* allowed object is
* {@link XMLGregorianCalendar }
*
*/
public void setModifiedDate(XMLGregorianCalendar value) {
this.modifiedDate = value;
}
/**
* Gets the value of the numericValue property.
*
* @return
* possible object is
* {@link Integer }
*
*/
public Integer getNumericValue() {
return numericValue;
}
/**
* Sets the value of the numericValue property.
*
* @param value
* allowed object is
* {@link Integer }
*
*/
public void setNumericValue(Integer value) {
this.numericValue = value;
}
/**
* Gets the value of the orderNo property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getOrderNo() {
return orderNo;
}
/**
* Sets the value of the orderNo property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setOrderNo(String value) {
this.orderNo = value;
}
/**
* Gets the value of the parentId property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getParentId() {
return parentId;
}
/**
* Sets the value of the parentId property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setParentId(String value) {
this.parentId = value;
}
/**
* Gets the value of the subCode property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getSubCode() {
return subCode;
}
/**
* Sets the value of the subCode property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setSubCode(String value) {
this.subCode = value;
}
/**
* Gets the value of the zeeValueCheck property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getZeeValueCheck() {
return zeeValueCheck;
}
/**
* Sets the value of the zeeValueCheck property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setZeeValueCheck(String value) {
this.zeeValueCheck = value;
}
}
| lgpl-3.0 |
tango-controls/JTango | dao/src/main/java/fr/esrf/TangoApi/events/KeepAliveThread.java | 6440 | //+======================================================================
// $Source$
//
// Project: Tango
//
// Description: java source code for the TANGO client/server API.
//
// $Author: pascal_verdier $
//
// Copyright (C) : 2004,2005,2006,2007,2008,2009,2010,2011,2012,2013,2014,
// European Synchrotron Radiation Facility
// BP 220, Grenoble 38043
// FRANCE
//
// This file is part of Tango.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
// $Revision: $
//
//-======================================================================
package fr.esrf.TangoApi.events;
import fr.esrf.TangoDs.TangoConst;
import java.util.Enumeration;
import java.util.Hashtable;
/**
* @author pascal_verdier
*/
//===============================================================
/**
* A class inherited from TimerTask class
*/
//===============================================================
class KeepAliveThread extends Thread implements TangoConst {
private static final long EVENT_RESUBSCRIBE_PERIOD = 600000;
private static final long EVENT_HEARTBEAT_PERIOD = 10000;
private static boolean stop = false;
private static KeepAliveThread instance = null;
//===============================================================
/**
* Creates a new instance of EventConsumer.KeepAliveThread
*/
//===============================================================
private KeepAliveThread() {
super();
this.setName("KeepAliveThread");
}
//===============================================================
//===============================================================
public void run() {
while (!stop) {
long t0 = System.currentTimeMillis();
try {
EventConsumer.subscribeIfNotDone();
resubscribe_if_needed();
}
catch (Exception e) {
e.printStackTrace();
}
catch (Error err) {
err.printStackTrace();
}
long msToSleep = EVENT_HEARTBEAT_PERIOD - (System.currentTimeMillis() - t0);
if (msToSleep<5)
msToSleep = 5;
waitNextLoop(msToSleep);
}
}
//===============================================================
//===============================================================
private synchronized void waitNextLoop(long ms) {
try {
wait(ms);
} catch (InterruptedException e) {
System.err.println(e);
}
}
//===============================================================
//===============================================================
synchronized void stopThread() {
stop = true;
if (instance!=null)
notify();
instance = null;
}
//===============================================================
//===============================================================
static KeepAliveThread getInstance() {
if (instance==null) {
instance = new KeepAliveThread();
instance.start();
}
return instance;
}
//===============================================================
//===============================================================
static boolean heartbeatHasBeenSkipped(EventChannelStruct eventChannelStruct) {
long now = System.currentTimeMillis();
//System.out.println(now + "-" + eventChannelStruct.last_heartbeat + "=" +
// (now - eventChannelStruct.last_heartbeat));
return ((now - eventChannelStruct.last_heartbeat) > EVENT_HEARTBEAT_PERIOD);
}
//===============================================================
//===============================================================
//===============================================================
//===============================================================
private void resubscribe_if_needed() {
Enumeration channel_names = EventConsumer.getChannelMap().keys();
long now = System.currentTimeMillis();
// check the list of not yet connected events and try to subscribe
while (channel_names.hasMoreElements()) {
String name = (String) channel_names.nextElement();
EventChannelStruct eventChannelStruct = EventConsumer.getChannelMap().get(name);
if ((now - eventChannelStruct.last_subscribed) > EVENT_RESUBSCRIBE_PERIOD / 3) {
reSubscribeByName(eventChannelStruct, name);
}
eventChannelStruct.consumer.checkIfHeartbeatSkipped(name, eventChannelStruct);
}// end while channel_names.hasMoreElements()
}
//===============================================================
/*
* Re subscribe event selected by name
*/
//===============================================================
private void reSubscribeByName(EventChannelStruct eventChannelStruct, String name) {
// Get the map and the callback structure for channel
Hashtable<String, EventCallBackStruct>
callBackMap = EventConsumer.getEventCallbackMap();
EventCallBackStruct callbackStruct = null;
Enumeration channelNames = callBackMap.keys();
while (channelNames.hasMoreElements()) {
String key = (String) channelNames.nextElement();
EventCallBackStruct eventStruct = callBackMap.get(key);
if (eventStruct.channel_name.equals(name)) {
callbackStruct = eventStruct;
}
}
// Get the callback structure
if (callbackStruct!=null) {
callbackStruct.consumer.reSubscribeByName(eventChannelStruct, name);
}
}
}
| lgpl-3.0 |
SirmaITT/conservation-space-1.7.0 | docker/sirma-platform/platform/seip-parent/model-management/definition-core/src/main/java/com/sirma/itt/seip/definition/jaxb/ConfigsType.java | 2973 | //
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference
// Implementation, v2.2.6
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2013.06.24 at 07:33:10 PM EEST
//
package com.sirma.itt.seip.definition.jaxb;
import java.util.ArrayList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>
* Java class for configsType complex type.
* <p>
* The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* <complexType name="configsType">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="config" type="{}configType" maxOccurs="unbounded" minOccurs="0"/>
* <element name="filter" type="{}filterType" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "configsType", propOrder = { "config", "filter" })
public class ConfigsType {
/** The config. */
protected List<ConfigType> config;
/** The filter. */
protected List<FilterType> filter;
/**
* Gets the value of the config property.
* <p>
* This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to
* the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for
* the config property.
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getConfig().add(newItem);
* </pre>
* <p>
* Objects of the following type(s) are allowed in the list {@link ConfigType }
*
* @return the config
*/
public List<ConfigType> getConfig() {
if (config == null) {
config = new ArrayList<>();
}
return config;
}
public void setConfig(List<ConfigType> config) {
this.config = config;
}
/**
* Gets the value of the filter property.
* <p>
* This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to
* the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for
* the filter property.
* <p>
* For example, to add a new item, do as follows:
*
* <pre>
* getFilter().add(newItem);
* </pre>
* <p>
* Objects of the following type(s) are allowed in the list {@link FilterType }
*
* @return the filter
*/
public List<FilterType> getFilter() {
if (filter == null) {
filter = new ArrayList<>();
}
return filter;
}
public void setFilter(List<FilterType> filter) {
this.filter = filter;
}
}
| lgpl-3.0 |
sbreuils/EssaiCompile | clucalc/src/test/java/de/gaalop/clucalc/CodegenTest.java | 2047 | package de.gaalop.clucalc;
import org.junit.Test;
public class CodegenTest {
@Test
public void test() {
} /*
public static final File MAPLE_PATH = new File("C:/Programs/Maple 9.5/");
private ControlFlowGraph parseCluCalc(String text) throws RecognitionException {
CluCalcLexer lexer = new CluCalcLexer(new ANTLRStringStream(text));
CluCalcParser parser = new CluCalcParser(new CommonTokenStream(lexer));
CluCalcParser.script_return result = parser.script();
CluCalcTransformer transformer = new CluCalcTransformer(new CommonTreeNodeStream(result.getTree()));
ControlFlowGraph cfg = transformer.script();
return cfg;
}
@BeforeClass
public static void initMaple() throws Exception {
Maple.initialize(new File(MAPLE_PATH, "java"), new File(MAPLE_PATH, "bin.win"));
}
@Test
public void testEvaluate() throws Exception {
String text = "DefVarsN3()\nS = e0-0.5*r*r*einf;\n" +
"P = VecN3(x,y,z);\n" +
"?C = S^(P+(P.S)*einf);";
generateCode(text);
}
private void generateCode(String text) throws RecognitionException {
ControlFlowGraph graph = parseCluCalc(text);
MapleSimplifier simplifier = new MapleSimplifier();
simplifier.simplify(graph);
GaTransformer transformer = new GaTransformer();
transformer.transformBlades(simplifier, graph);
CluCalcCodeGenerator gen = new CluCalcCodeGenerator();
Set<OutputFile> files = gen.generate(graph);
for (OutputFile file : files) {
System.out.println("file = " + file);
}
}
@Test
public void testTwoSpheres() throws Exception {
String text = "DefVarsN3();\n" +
"CA = VecN3(c1, c2, c3) - f * einf;\n" +
"DB = VecN3(d1, d2, d3) - g * einf;\n" +
"?K=CA^DB;";
generateCode(text);
}
*/
}
| lgpl-3.0 |
yawlfoundation/yawl | src/org/yawlfoundation/yawl/controlpanel/editor/EditorLauncher.java | 3453 | /*
* Copyright (c) 2004-2020 The YAWL Foundation. All rights reserved.
* The YAWL Foundation is a collaboration of individuals and
* organisations who are committed to improving workflow technology.
*
* This file is part of YAWL. YAWL is free software: you can
* redistribute it and/or modify it under the terms of the GNU Lesser
* General Public License as published by the Free Software Foundation.
*
* YAWL is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
* Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with YAWL. If not, see <http://www.gnu.org/licenses/>.
*/
package org.yawlfoundation.yawl.controlpanel.editor;
import org.yawlfoundation.yawl.controlpanel.components.ToolBar;
import javax.swing.*;
import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
/**
* @author Michael Adams
* @date 14/05/15
*/
public class EditorLauncher {
ToolBar _btnPanel;
public EditorLauncher(ToolBar btnPanel) {
_btnPanel = btnPanel;
}
public void launch() {
try {
List<String> command = new ArrayList<String>();
command.add(getJavaPath());
command.add("-Xms256m");
command.add("-Xmx256m");
command.add("-jar");
command.add(getEditorPath());
ProcessBuilder builder = new ProcessBuilder(command);
monitor(builder.start());
}
catch (Exception e) {
JOptionPane.showMessageDialog(_btnPanel, e.getMessage(),
"Error Starting Editor",
JOptionPane.ERROR_MESSAGE);
}
}
private String getEditorPath() throws URISyntaxException, IOException {
File baseDir = getJarFile().getParentFile().getParentFile();
File editorDir = new File(baseDir, "editor");
File[] fileList = editorDir.listFiles();
if (fileList == null) throw new IOException("Editor jar not found.");
for (File f : fileList) {
if (f.isFile() && f.getName().startsWith("YAWLEditor") &&
f.getName().endsWith(".jar")) {
return f.getAbsolutePath();
}
}
throw new IOException("Editor jar not found.");
}
private File getJarFile() throws URISyntaxException {
return new File(this.getClass().getProtectionDomain()
.getCodeSource().getLocation().toURI());
}
private String getJavaPath() {
return System.getProperty("java.home") + File.separator +
"bin" + File.separator + "java";
}
private void monitor(Process proc) {
Thread t = new Thread(new ProcessMonitor(proc));
t.start();
}
/***********************************************************************/
class ProcessMonitor implements Runnable {
private final Process _proc;
ProcessMonitor(Process proc) { _proc = proc; }
public void run() {
try {
_proc.waitFor();
}
catch (Exception e) {
//
}
_btnPanel.enableEditorButton(true);
}
}
}
| lgpl-3.0 |
esdc-esac-esa-int/gaia | sl/tags/gaia-sl-tap-0.5.3-20150629/src/java/esac/archive/gacs/sl/tap/adql/ReplacePointHandler.java | 2397 | /*******************************************************************************
* Copyright (C) 2017 European Space Agency
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* 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 Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
******************************************************************************/
package esac.archive.gacs.sl.tap.adql;
import esavo.adql.db.DBColumn;
import esavo.adql.db.DBTable;
import esavo.adql.query.ADQLObject;
import esavo.adql.query.operand.ADQLColumn;
import esavo.adql.query.operand.function.geometry.PointFunction;
import esavo.adql.search.SimpleReplaceHandler;
/**
* Replace all POINT('...', ra, dec) by coord.
*/
public class ReplacePointHandler extends SimpleReplaceHandler {
@Override
protected boolean match(ADQLObject obj) {
if (obj instanceof PointFunction){
PointFunction point = (PointFunction)obj;
if (point.getCoord1() instanceof ADQLColumn && point.getCoord2() instanceof ADQLColumn){
ADQLColumn coord1 = (ADQLColumn)point.getCoord1(), coord2 = (ADQLColumn)point.getCoord2();
if (coord1.getDBLink() == null)
return coord1.getColumnName().equalsIgnoreCase("ra") && coord2.getColumnName().equalsIgnoreCase("dec");
else
return coord1.getDBLink().getDBName().equalsIgnoreCase("ra") && coord2.getDBLink().getDBName().equalsIgnoreCase("dec");
}
}
return false;
}
@Override
protected ADQLObject getReplacer(ADQLObject obj) throws UnsupportedOperationException {
PointFunction point = (PointFunction)obj;
if (((ADQLColumn)point.getCoord1()).getDBLink() == null)
return new ADQLColumn("coord");
else{
DBTable t = ((ADQLColumn)point.getCoord1()).getDBLink().getTable();
DBColumn coordColumn = t.getColumn("coord", false);
ADQLColumn col = new ADQLColumn("coord");
col.setDBLink(coordColumn);
return col;
}
}
}
| lgpl-3.0 |
Mindtoeye/Hoop | src/edu/cmu/cs/in/ml/bayesiannet/JavaBayesInterface/ObserveDialog.java | 4600 | /**
* ObserveDialog.java
* @author Fabio G. Cozman
* Original version by Sreekanth Nagarajan, rewritten from scratch
* by Fabio Cozman.
* Copyright 1996 - 1999, Fabio G. Cozman,
* Carnergie Mellon University, Universidade de Sao Paulo
* fgcozman@usp.br, http://www.cs.cmu.edu/~fgcozman/home.html
*
* The JavaBayes distribution 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),
* provided that this notice and the name of the author appear in all
* copies. Upon request to the author, some of the packages in the
* JavaBayes distribution can be licensed under the GNU Lesser General
* Public License as published by the Free Software Foundation (either
* version 2 of the License, or (at your option) any later version).
* If you're using the software, please notify fgcozman@usp.br so
* that you can receive updates and patches. JavaBayes is distributed
* "as is", 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 the JavaBayes distribution. If not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package edu.cmu.cs.in.ml.bayesiannet.JavaBayesInterface;
//import edu.cmu.cs.in.ml.bayesiannet.*;
import java.awt.*;
import edu.cmu.cs.in.ml.bayesiannet.InferenceGraphs.InferenceGraph;
import edu.cmu.cs.in.ml.bayesiannet.InferenceGraphs.InferenceGraphNode;
class ObserveDialog extends Dialog {
NetworkPanel npan;
InferenceGraph ig;
InferenceGraphNode node;
boolean observed;
Checkbox observedBox;
List valuesList;
/* ************************************************* *
* Default constructor for an ObserveDialog object. *
* ************************************************* */
public ObserveDialog(NetworkPanel network_panel, Frame parent,
InferenceGraph i_g, InferenceGraphNode node) {
super(parent, "Set Observe Value", true);
this.ig = i_g;
this.node = node;
this.npan = network_panel;
Panel cbp = new Panel();
cbp.setLayout(new FlowLayout(FlowLayout.CENTER));
observed = node.is_observed();
observedBox = new Checkbox("Observed", null, observed);
cbp.add(observedBox);
Panel listp = new Panel();
listp.setLayout(new GridLayout(1, 1));
valuesList = new List(6, false);
String[] values = node.get_values();
for (int i=0; i < values.length; i++)
valuesList.addItem(new String(values[i]));
if (observed) {
valuesList.select(node.get_observed_value());
}
listp.add(valuesList);
Panel okp = new Panel();
okp.setLayout(new FlowLayout(FlowLayout.CENTER));
okp.add(new Button("Ok"));
okp.add(new Button("Cancel"));
setLayout(new BorderLayout());
add("North", cbp);
add("Center", listp);
add("South", okp);
pack();
}
/* ************************************************** *
* Handle the observation events. *
* ************************************************** */
public boolean action(Event evt, Object arg) {
if (evt.target == observedBox) {
observed = observedBox.getState();
if (observed)
valuesList.select(0); // select first value by default
else // clear any selection
valuesList.deselect(valuesList.getSelectedIndex());
return super.action(evt, arg);
} else if (evt.target == valuesList) {
if (! observed) {
observed = true;
observedBox.setState(observed);
}
return super.action(evt, arg);
} else if (arg.equals("Ok")) {
String selValue = null;
observed = observedBox.getState();
selValue = valuesList.getSelectedItem();
if (observed && selValue == null) {
JavaBayesHelpMessages.show(JavaBayesHelpMessages.observe_error);
return true; // do not close this dialog box
}
if (observed)
node.set_observation_value(selValue);
else
node.clear_observation();
npan.repaint();
dispose();
} else if (arg.equals("Cancel")) {
dispose();
} else return super.action(evt, arg);
return true;
}
}
| lgpl-3.0 |
mdamis/unilabIDE | Unitex-Java/src/fr/umlv/unitex/exceptions/MissingGraphNameException.java | 1241 | /*
* Unitex
*
* Copyright (C) 2001-2014 Université Paris-Est Marne-la-Vallée <unitex@univ-mlv.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*
*/
package fr.umlv.unitex.exceptions;
/**
* This class defines an <code>Exception</code> that is thrown when the user
* wants to validate a box content that contains an unprotected ':' character
* that is not followed by a graph name.
*
* @author Sébastien Paumier
*
*/
public class MissingGraphNameException extends Exception {
// nothing to do
}
| lgpl-3.0 |
michaelpetruzzellocivicom/ari4java | classes/ch/loway/oss/ari4java/generated/ari_1_5_0/models/RecordingFailed_impl_ari_1_5_0.java | 1227 | package ch.loway.oss.ari4java.generated.ari_1_5_0.models;
// ----------------------------------------------------
// THIS CLASS WAS GENERATED AUTOMATICALLY
// PLEASE DO NOT EDIT
// Generated on: Tue Dec 19 09:55:49 CET 2017
// ----------------------------------------------------
import ch.loway.oss.ari4java.generated.*;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**********************************************************
* Event showing failure of a recording operation.
*
* Defined in file: events.json
* Generated by: Model
*********************************************************/
public class RecordingFailed_impl_ari_1_5_0 extends Event_impl_ari_1_5_0 implements RecordingFailed, java.io.Serializable {
private static final long serialVersionUID = 1L;
/** Recording control object */
private LiveRecording recording;
public LiveRecording getRecording() {
return recording;
}
@JsonDeserialize( as=LiveRecording_impl_ari_1_5_0.class )
public void setRecording(LiveRecording val ) {
recording = val;
}
/** No missing signatures from interface */
}
| lgpl-3.0 |
ChenTH/LeetCodeSolutions | src/com/cth/backup/stack/ImplementStackusingQueues.java | 1418 | package com.cth.backup.stack;
import java.util.LinkedList;
import java.util.Queue;
public class ImplementStackusingQueues {
public static void main(String[] args) {
// TODO Auto-generated method stub
MyStack stack = new MyStack();
stack.push(1);
System.out.println(stack.empty());
}
}
class MyStack {
// Push element x onto stack.
Queue<Integer> queue1 = new LinkedList<>();
Queue<Integer> queue2 = new LinkedList<>();
public void push(int x) {
if (queue1.isEmpty()) {
queue1.offer(x);
while (!(queue2.isEmpty())) {
queue1.offer(queue2.poll());
}
} else {
queue2.offer(x);
while (!(queue1.isEmpty())) {
queue2.offer(queue1.poll());
}
}
}
// Removes the element on top of the stack.
public void pop() {
if (queue1.isEmpty()) {
queue2.poll();
} else {
queue1.poll();
}
}
// Get the top element.
public int top() {
if (queue1.isEmpty()) {
return queue2.peek();
} else {
return queue1.peek();
}
}
// Return whether the stack is empty.
public boolean empty() {
if (queue1.isEmpty() && queue2.isEmpty()) {
return true;
} else {
return false;
}
}
} | lgpl-3.0 |
johhud1/BinnableGraphView | src/com/jjoe64/graphview/BinBarGraphView.java | 6518 | package com.jjoe64.graphview;
import android.content.Context;
import android.graphics.Canvas;
import android.provider.CalendarContract.Reminders;
import android.util.Log;
import com.jjoe64.graphview.GraphViewSeries.GraphViewSeriesStyle;
public class BinBarGraphView extends GraphView {
private boolean isNumBins;
private double binValue;
private double remainder;
/**
* i wanna call this the reverse remainder, probably has a real name. =
* (binSize - remainder)
**/
private double rremainder;
private static final long SEC = 1000;
private static final long MIN = 60 * SEC;
private static final long HOUR = 60 * MIN;
private static final long DAY = 24 * HOUR;
private static final long WEEK = 7 * DAY;
/**
* This GraphView subclass will generate a Bar-style GraphView with the
* given number of bins, or bins of the given size. Binning the data
* appropriately, even while zooming. To clarify, if isNumBins is set to
* true; then when the user zooms, then number of bins in the graph will
* remain constant (equal to numBinsOrSize), and the size of the bins will
* change to keep the same number in the viewport as the viewport is
* resized. If isNumBins is false, then the range of the bins will remain
* constant while the viewport is resized.
*
* @param context
* @param title
* @param isNumBins
* True indicates the number of bins in view on the graph is held
* constant regardless of changes in the viewport. False means
* the size of the bins are held constant.
* @param numBinsOrSize
* if isNumBins is true, indicates the number of bins you would
* like to have the data grouped in, if numBins is false this
* parameters determines the bin size.
*/
public BinBarGraphView(Context context, String title, boolean isNumBins,
long numBinsOrSizes) {
super(context, title);
this.isNumBins = isNumBins;
this.binValue = numBinsOrSizes;
}
public BinBarGraphView(Context context, String title, boolean isNumBins,
long numBinsOrSize, boolean customGraphContentView) {
super(context, title, customGraphContentView);
this.isNumBins = isNumBins;
this.binValue = numBinsOrSize;
}
public void setNumBins(int numBins) {
isNumBins = true;
this.binValue = numBins;
invalidate();
}
public void setBinSize(long binSize) {
isNumBins = false;
binValue = binSize;
redrawAll();
}
public double getBinSize() {
if (!isNumBins) {
return binValue;
} else {
return (viewportSize / binValue);
}
}
@Override
protected void drawSeries(Canvas canvas, GraphViewDataInterface[] values,
float graphwidth, float graphheight, float border, double minX,
double minY, double diffX, double diffY, float horstart,
GraphViewSeriesStyle style) {
float remainderRatX = (float) (remainder / getBinSize());
float rremainderRatX = (float) (rremainder / getBinSize());
//numBins is fractional. not necessarily integer
double numBins = values.length;
float colwidth = (float) (graphwidth / (viewportSize / getBinSize()));// (float) (graphwidth /
// numBins);
Log.d("drawSeries", "numBins = " + binValue + " binValue = " + binValue);
paint.setStrokeWidth(style.thickness);
paint.setColor(style.color);
// draw data
for (int i = 0; i < values.length; i++) {
float valY = (float) (values[i].getY() - minY);
float ratY = (float) (valY / diffY);
float y = graphheight * ratY;
// hook for value dependent color
if (style.getValueDependentColor() != null) {
paint.setColor(style.getValueDependentColor().get(values[i]));
}
if (i == 0) {
canvas.drawRect(horstart, (border - y) + graphheight,
((rremainderRatX * colwidth) + horstart - 1),
graphheight + border - 1, paint);
horstart += (rremainderRatX * colwidth);
}
if (i == values.length) {
canvas.drawRect(
((i - 1 + remainderRatX) * colwidth) + horstart,
(border - y) + graphheight,
(((i - 1) * colwidth) + horstart) + (colwidth - 1),
graphheight + border - 1, paint);
} else
canvas.drawRect(((i - 1) * colwidth) + horstart, (border - y)
+ graphheight, (((i - 1) * colwidth) + horstart)
+ (colwidth - 1), graphheight + border - 1, paint);
}
}
@Override
protected GraphViewDataInterface[] _values(int idxSeries) {
if (isNumBins) {
// calculate binsize given binValue bins in graph
double binSize = viewportSize / binValue;
return binData(graphSeries.get(idxSeries).values, binSize);
} else {
// just bin data according to binsize
return binData(graphSeries.get(idxSeries).values, binValue);
}
}
private GraphViewData[] binData(GraphViewDataInterface[] data,
double binSize) {
// double range = data[data.length - 1].getX() - data[0].getX();
double range = viewportSize;
int numBins = (int) Math.ceil(range / binSize) + 1;
return binData(data, numBins, binSize);
}
private GraphViewData[] binData(GraphViewDataInterface[] data, int numBins,
double binSize) {
remainder = viewportStart % binSize;
rremainder = binSize - remainder;
double curBinCeiling = viewportStart + rremainder;
double curBinFloor = viewportStart - remainder;
GraphViewData bins[] = new GraphViewData[numBins];
int valuesIndex = 0;
for (int i = 0; i < numBins; i++) {
int y = 0;
while ((valuesIndex < data.length)
&& (data[valuesIndex].getX() < curBinFloor)) {
valuesIndex++;
}
while ((valuesIndex < data.length)
&& (data[valuesIndex].getX() < curBinCeiling)
&& (data[valuesIndex].getX() >= curBinFloor)) {
y++;
valuesIndex++;
}
GraphViewData bin = new GraphViewData(curBinFloor, y);
bins[i] = bin;
curBinFloor = curBinCeiling;
curBinCeiling += binSize;
}
return bins;
}
@Override
protected String buildTitle() {
String unitStr = "no unit";
double unit = 0;
if (isNumBins) {
double binSize = viewportSize / binValue;
if (binSize / MIN < 60) {
unitStr = "min";
unit = binSize / MIN;
} else if (binSize / HOUR < 24) {
unitStr = "hour";
unit = binSize / HOUR;
} else {
unitStr = "days";
unit = binSize / DAY;
}
} else {
if ((binValue / MIN) < 60) {
unitStr = "min";
unit = binValue / MIN;
} else if (binValue / HOUR < 24) {
unitStr = "hour";
unit = binValue / HOUR;
} else {
unitStr = "days";
unit = binValue / DAY;
}
}
return title + " (bin: " + String.format("%.2f", unit) + " " + unitStr
+ " )";
}
}
| lgpl-3.0 |
flamingchickens1540/Common-Chicken-Runtime-Engine | CommonChickenRuntimeEngine/tests/ccre/testing/CountingBooleanOutput.java | 2685 | /*
* Copyright 2014-2016 Cel Skeggs
*
* This file is part of the CCRE, the Common Chicken Runtime Engine.
*
* The CCRE is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* The CCRE is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the CCRE. If not, see <http://www.gnu.org/licenses/>.
*/
package ccre.testing;
import static org.junit.Assert.*;
import ccre.channel.BooleanOutput;
/**
* A class used to ensure that an output is only set to the correct value and in
* the correct interval of time - and not anywhen else.
*
* Set {@link #valueExpected} to the expected value and {@link #ifExpected} to
* true, let the code run that should update the value, and then call
* {@link #check()}.
*
* If a value is received when ifExpected is not set, an exception will be
* thrown. Note that this also happens if a value is received more than once,
* because ifExpected is cleared after the first value written.
*
* check() will fail if ifExpected is still true, because that means that means
* that the value was never received.
*
* @author skeggsc
*/
public class CountingBooleanOutput implements BooleanOutput {
/**
* The value expected to be received.
*/
public boolean valueExpected;
/**
* Whether or not we're still expected a value to be received.
*/
public boolean ifExpected;
private boolean anyUnexpected;
@Override
public synchronized void set(boolean value) {
if (!ifExpected) {
anyUnexpected = true;
fail("Unexpected set: " + value);
}
if (value != valueExpected) {
anyUnexpected = true;
fail("Incorrect set: " + value + " instead of " + valueExpected);
}
ifExpected = false;
}
/**
* Ensure that the correct value has been received since the last time that
* ifExpected was set to true.
*
* @throws RuntimeException if a write did not occur.
*/
public void check() throws RuntimeException {
assertFalse("Already failed earlier!", anyUnexpected);
if (ifExpected) {
anyUnexpected = true;
fail("Did not get expected set of " + valueExpected + "!");
}
}
}
| lgpl-3.0 |
Mindtoeye/Hoop | src/org/jdesktop/swingx/editors/PaintPropertyEditor.java | 5138 | /*
* PainterPropertyEditor.java
*
* Created on March 21, 2006, 11:26 AM
*
* To change this template, choose Tools | Template Manager
* and open the template in the editor.
*/
package org.jdesktop.swingx.editors;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Paint;
import java.awt.Rectangle;
import java.beans.PropertyEditorSupport;
import java.util.HashMap;
import java.util.Map;
/**
* Two parts to this property editor. The first part is a simple dropdown.
* The second part is a complicated UI for constructing multiple "layers" of
* various different Painters, including gradient paints.
*
* @author Richard
*/
public class PaintPropertyEditor extends PropertyEditorSupport {
private static Map<Paint, String> DEFAULT_PAINTS = new HashMap<Paint, String>();
static {
//add the default paints
DEFAULT_PAINTS.put(Color.BLACK, "Black");
DEFAULT_PAINTS.put(Color.BLUE, "Blue");
DEFAULT_PAINTS.put(Color.CYAN, "Cyan");
DEFAULT_PAINTS.put(Color.DARK_GRAY, "Dark Gray");
DEFAULT_PAINTS.put(Color.GRAY, "Gray");
DEFAULT_PAINTS.put(Color.GREEN, "Green");
DEFAULT_PAINTS.put(Color.LIGHT_GRAY, "Light Gray");
DEFAULT_PAINTS.put(Color.MAGENTA, "Magenta");
DEFAULT_PAINTS.put(Color.ORANGE, "Orange");
DEFAULT_PAINTS.put(Color.PINK, "Pink");
DEFAULT_PAINTS.put(Color.RED, "Red");
DEFAULT_PAINTS.put(Color.WHITE, "White");
DEFAULT_PAINTS.put(Color.YELLOW, "Yellow");
DEFAULT_PAINTS.put(new Color(1f, 1f, 1f, 0f), "Transparent");
// DEFAULT_PAINTS.put(
// BasicGradientPainter.WHITE_TO_CONTROL_HORZONTAL, "White->Control (horizontal)");
// DEFAULT_PAINTS.put(
// BasicGradientPainter.WHITE_TO_CONTROL_VERTICAL, "White->Control (vertical)");
/* josh: this should be replaced with matte painters
DEFAULT_PAINTS.put(
BasicGradientPainter.AERITH, "Aerith");
DEFAULT_PAINTS.put(
BasicGradientPainter.BLUE_EXPERIENCE, "Blue Experience");
DEFAULT_PAINTS.put(
BasicGradientPainter.GRAY, "Gray Gradient");
DEFAULT_PAINTS.put(
BasicGradientPainter.MAC_OSX, "Mac OSX");
DEFAULT_PAINTS.put(
BasicGradientPainter.MAC_OSX_SELECTED, "Max OSX Selected");
DEFAULT_PAINTS.put(
BasicGradientPainter.NIGHT_GRAY, "Night Gray");
DEFAULT_PAINTS.put(
BasicGradientPainter.NIGHT_GRAY_LIGHT, "Night Gray Light");
DEFAULT_PAINTS.put(
BasicGradientPainter.RED_XP, "Red XP");
DEFAULT_PAINTS.put(
LinearGradientPainter.BLACK_STAR, "Black Star");
DEFAULT_PAINTS.put(
LinearGradientPainter.ORANGE_DELIGHT, "Orange Delight");*/
}
/** Creates a new instance of PainterPropertyEditor */
public PaintPropertyEditor() {
}
@Override
public String[] getTags() {
String[] names = DEFAULT_PAINTS.values().toArray(new String[0]);
String[] results = new String[names.length+1];
results[0] = "<none>";
System.arraycopy(names, 0, results, 1, names.length);
return results;
}
@Override
public Paint getValue() {
return (Paint)super.getValue();
}
@Override
public String getJavaInitializationString() {
Paint paint = getValue();
//TODO!!!
return paint == null ? "null" :
"org.jdesktop.swingx.painter.gradient.LinearGradientPainter.BLACK_STAR";
}
@Override
public void setAsText(String text) throws IllegalArgumentException {
if (text == null || text.trim().equals("") || text.trim().equalsIgnoreCase("none")
|| text.trim().equalsIgnoreCase("<none>")
|| text.trim().equalsIgnoreCase("[none]")) {
setValue(null);
return;
}
if (text.trim().equalsIgnoreCase("<custom>")) {
//do nothing
}
for (Map.Entry<Paint, String> entry : DEFAULT_PAINTS.entrySet()) {
if (entry.getValue().equalsIgnoreCase(text)) {
setValue(entry.getKey());
return;
}
}
throw new IllegalArgumentException("The input value " + text + " does" +
" not match one of the names of the standard paints");
}
@Override
public String getAsText() {
Paint p = getValue();
if (p == null) {
return null;
} else if (DEFAULT_PAINTS.containsKey(p)) {
return DEFAULT_PAINTS.get(p);
} else {
return "<custom>";
}
}
@Override
public void paintValue(Graphics gfx, Rectangle box) {
Paint p = getValue();
if (p == null) {
//do nothing -- in the future draw the checkerboard or something
} else {
((Graphics2D)gfx).setPaint(p);
gfx.fillRect(box.x, box.y, box.width, box.height);
}
}
@Override
public boolean isPaintable() {
return true;
}
}
| lgpl-3.0 |
teryk/sonarqube | sonar-core/src/main/java/org/sonar/core/measure/MeasurementFilter.java | 1409 | /*
* SonarQube, open source software quality management tool.
* Copyright (C) 2008-2014 SonarSource
* mailto:contact AT sonarsource DOT com
*
* SonarQube is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* SonarQube is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.core.measure;
import org.sonar.api.BatchExtension;
import org.sonar.api.resources.Resource;
import org.sonar.api.measures.Measure;
/**
* Allows to define filter {@link Measure}s when they are saved on {@link Resource}s
* @since 4.0
*
*/
public interface MeasurementFilter extends BatchExtension {
/**
*
* @param resource
* @param measure
* @return <code>true</code> if the given measure can be saved for the given resource
*/
boolean accept(Resource resource, Measure measure);
}
| lgpl-3.0 |
aploese/spsw | de.ibapl.spsw.api.tests/src/main/java/de/ibapl/spsw/tests/PortConfigurationFactory.java | 7726 | /*
* SPSW - Drivers for the serial port, https://github.com/aploese/spsw/
* Copyright (C) 2009-2021, Arne Plöse and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 3 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package de.ibapl.spsw.tests;
import de.ibapl.jnhw.libloader.NativeLibResolver;
import de.ibapl.jnhw.libloader.OS;
import java.util.Iterator;
import java.util.Set;
import de.ibapl.spsw.api.DataBits;
import de.ibapl.spsw.api.FlowControl;
import de.ibapl.spsw.api.Parity;
import de.ibapl.spsw.api.Speed;
import de.ibapl.spsw.api.StopBits;
import java.util.EnumSet;
/**
* Helper class for iterative tests.
*
* @author Arne Plöse
*
*/
public class PortConfigurationFactory {
static class PortConfigurationImpl implements PortConfiguration {
private int bufferSize = 1024;
private DataBits dataBits = DataBits.DB_8;
private Set<FlowControl> flowControl = FlowControl.getFC_NONE(); // getFC_RTS_CTS();
private int interByteReadTimeout = 100;
private int overallReadTimeout = 3000;
private int overallWriteTimeout = 3000;
private Parity parity = Parity.NONE;
private Speed speed = Speed._9600_BPS;
private StopBits stopBits = StopBits.SB_1;
public PortConfigurationImpl() {
}
public PortConfigurationImpl(PortConfigurationImpl portConfigurationImpl) {
this.bufferSize = portConfigurationImpl.bufferSize;
this.flowControl = portConfigurationImpl.flowControl;
this.parity = portConfigurationImpl.parity;
this.stopBits = portConfigurationImpl.stopBits;
this.dataBits = portConfigurationImpl.dataBits;
this.speed = portConfigurationImpl.speed;
this.interByteReadTimeout = portConfigurationImpl.interByteReadTimeout;
this.overallReadTimeout = portConfigurationImpl.overallReadTimeout;
this.overallWriteTimeout = portConfigurationImpl.overallWriteTimeout;
}
public void adjustTimeouts() {
overallReadTimeout = calcMaxTransferTime();
overallWriteTimeout = overallReadTimeout;
}
@Override
public int getBufferSize() {
return bufferSize;
}
@Override
public DataBits getDataBits() {
return dataBits;
}
@Override
public Set<FlowControl> getFlowControl() {
return flowControl;
}
@Override
public int getInterByteReadTimeout() {
return interByteReadTimeout;
}
@Override
public int getOverallReadTimeout() {
return overallReadTimeout;
}
@Override
public int getOverallWriteTimeout() {
return overallWriteTimeout;
}
@Override
public Parity getParity() {
return parity;
}
@Override
public Speed getSpeed() {
return speed;
}
@Override
public StopBits getStopBits() {
return stopBits;
}
@Override
public String toString() {
return String.format("Port Configuration %s, %s, %s, %s, fC: %s, iBTO: %d, oRTO: %d, oWTO: %d, bS: %d",
speed, dataBits, stopBits, parity, flowControl, interByteReadTimeout, overallReadTimeout,
overallWriteTimeout, bufferSize);
}
}
private PortConfigurationImpl portConfigurationImpl = new PortConfigurationImpl();
public Iterator<PortConfiguration> getBaselineParityIterator() {
return new Iterator<PortConfiguration>() {
//FreeBSD does not support Parity.MARK and Parity.SPACE so drop it for the baseline tests
Iterator<Parity> parities = EnumSet.of(Parity.NONE, Parity.ODD, Parity.EVEN).iterator();
@Override
public boolean hasNext() {
return parities.hasNext();
}
@Override
public PortConfiguration next() {
return of(parities.next());
}
};
}
public Iterator<PortConfiguration> getSpeedIterator(final Speed first, final Speed last) {
if (last.ordinal() < first.ordinal()) {
throw new IllegalArgumentException("Last must be greater than first speed");
}
return new Iterator<PortConfiguration>() {
int currentIndex = first.ordinal();
int lastIndex = last.ordinal();
Speed speeds[] = Speed.values();
@Override
public boolean hasNext() {
return currentIndex <= lastIndex;
}
@Override
public PortConfiguration next() {
return of(speeds[currentIndex++]);
}
};
}
public PortConfiguration of(Parity parity) {
final PortConfigurationImpl result = new PortConfigurationImpl(portConfigurationImpl);
result.parity = parity;
result.adjustTimeouts();
return result;
}
public PortConfiguration of(Speed speed) {
final PortConfigurationImpl result = new PortConfigurationImpl(portConfigurationImpl);
result.speed = speed;
result.adjustTimeouts();
return result;
}
public PortConfiguration ofBuffersize(int bufferSize) {
final PortConfigurationImpl result = new PortConfigurationImpl(portConfigurationImpl);
result.bufferSize = bufferSize;
result.adjustTimeouts();
return result;
}
public PortConfiguration ofCurrent() {
final PortConfigurationImpl result = new PortConfigurationImpl(portConfigurationImpl);
result.adjustTimeouts();
return result;
}
public PortConfigurationFactory setBuffersize(int bufferSize) {
portConfigurationImpl.bufferSize = bufferSize;
return this;
}
public PortConfigurationFactory setDataBits(DataBits dataBits) {
portConfigurationImpl.dataBits = dataBits;
return this;
}
public PortConfigurationFactory setFlowControl(Set<FlowControl> flowControl) {
portConfigurationImpl.flowControl = flowControl;
return this;
}
public PortConfigurationFactory setParity(Parity parity) {
if ((parity == Parity.MARK) && (NativeLibResolver.getOS() == OS.FREE_BSD || NativeLibResolver.getOS() == OS.DARWIN)) {
throw new IllegalArgumentException("Parity MARK and SPACE are not supported under MAcOS and FreeBSD");
}
portConfigurationImpl.parity = parity;
return this;
}
public PortConfigurationFactory setSpeed(Speed speed) {
portConfigurationImpl.speed = speed;
return this;
}
public PortConfigurationFactory setStopBits(StopBits stopBits) {
portConfigurationImpl.stopBits = stopBits;
return this;
}
}
| lgpl-3.0 |
Builders-SonarSource/sonarqube-bis | sonar-core/src/test/java/org/sonar/core/util/ProtobufTest.java | 4816 | /*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.core.util;
import java.io.File;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import org.junit.rules.TemporaryFolder;
import org.sonar.test.TestUtils;
import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.sonar.core.test.Test.Fake;
import static org.sonar.core.util.Protobuf.setNullable;
public class ProtobufTest {
@Rule
public ExpectedException thrown = ExpectedException.none();
@Rule
public TemporaryFolder temp = new TemporaryFolder();
@Test
public void only_utils() {
assertThat(TestUtils.hasOnlyPrivateConstructors(Protobuf.class)).isTrue();
}
@Test
public void read_file_fails_if_file_does_not_exist() throws Exception {
thrown.expect(ContextException.class);
thrown.expectMessage("Unable to read message");
File file = temp.newFile();
FileUtils.forceDelete(file);
Protobuf.read(file, Fake.parser());
}
@Test
public void read_file_returns_empty_message_if_file_is_empty() throws Exception {
File file = temp.newFile();
Fake msg = Protobuf.read(file, Fake.parser());
assertThat(msg).isNotNull();
assertThat(msg.isInitialized()).isTrue();
}
@Test
public void read_file_returns_message() throws Exception {
File file = temp.newFile();
Protobuf.write(Fake.getDefaultInstance(), file);
Fake message = Protobuf.read(file, Fake.parser());
assertThat(message).isNotNull();
assertThat(message.isInitialized()).isTrue();
}
@Test
public void fail_to_write_single_message() throws Exception {
thrown.expect(ContextException.class);
thrown.expectMessage("Unable to write message");
File dir = temp.newFolder();
Protobuf.write(Fake.getDefaultInstance(), dir);
}
@Test
public void write_and_read_streams() throws Exception {
File file = temp.newFile();
Fake item1 = Fake.newBuilder().setLabel("one").setLine(1).build();
Fake item2 = Fake.newBuilder().setLabel("two").build();
Protobuf.writeStream(asList(item1, item2), file, false);
CloseableIterator<Fake> it = Protobuf.readStream(file, Fake.parser());
Fake read = it.next();
assertThat(read.getLabel()).isEqualTo("one");
assertThat(read.getLine()).isEqualTo(1);
read = it.next();
assertThat(read.getLabel()).isEqualTo("two");
assertThat(read.hasLine()).isFalse();
assertThat(it.hasNext()).isFalse();
}
@Test
public void fail_to_read_stream() throws Exception {
thrown.expect(ContextException.class);
thrown.expectMessage("Unable to read messages");
File dir = temp.newFolder();
Protobuf.readStream(dir, Fake.parser());
}
@Test
public void read_empty_stream() throws Exception {
File file = temp.newFile();
CloseableIterator<Fake> it = Protobuf.readStream(file, Fake.parser());
assertThat(it).isNotNull();
assertThat(it.hasNext()).isFalse();
}
@Test
public void setNullable_sets_field_if_value_is_not_null() {
Fake.Builder builder = Fake.newBuilder();
setNullable("foo", builder::setLabel);
assertThat(builder.getLabel()).isEqualTo("foo");
builder.clear();
setNullable(null, builder::setLabel);
assertThat(builder.hasLabel()).isFalse();
}
@Test
public void setNullable_converts_value_and_sets_field_if_value_is_not_null() {
Fake.Builder builder = Fake.newBuilder();
setNullable("foo", builder::setLabel, StringUtils::upperCase);
assertThat(builder.getLabel()).isEqualTo("FOO");
builder.clear();
setNullable((String)null, builder::setLabel, StringUtils::upperCase);
assertThat(builder.hasLabel()).isFalse();
// do not set field if value is present but result of conversion is null
builder.clear();
setNullable(" ", builder::setLabel, StringUtils::trimToNull);
assertThat(builder.hasLabel()).isFalse();
}
}
| lgpl-3.0 |
akarnokd/open-ig | src/hu/openig/core/Btn3H.java | 606 | /*
* Copyright 2008-present, David Karnok & Contributors
* The file is part of the Open Imperium Galactica project.
*
* The code should be distributed under the LGPL license.
* See http://www.gnu.org/licenses/lgpl.html for details.
*/
package hu.openig.core;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* A three state button with "", "_hovered" and "_pressed" postfixed images.
* @author akarnokd, Mar 20, 2011
*/
@Retention(RetentionPolicy.RUNTIME)
public @interface Btn3H {
/** The resource name. */
String name();
}
| lgpl-3.0 |
Inversebit/LCIECG | clipsAndroid/src/main/java/eu/deustotech/clips/PrimitiveValue.java | 3681 | package eu.deustotech.clips;
import java.util.List;
public abstract class PrimitiveValue
{
private Object theValue;
/*******************/
/* PrimitiveValue: */
/*******************/
protected PrimitiveValue(
Object value)
{
theValue = value;
}
/*************/
/* getValue: */
/*************/
public Object getValue()
{
return theValue;
}
/****************/
/* numberValue: */
/****************/
public Number numberValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type NUMBER.");
}
/*************/
/* intValue: */
/*************/
public int intValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type INTEGER.");
}
/**************/
/* longValue: */
/**************/
public long longValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type INTEGER.");
}
/***************/
/* floatValue: */
/***************/
public float floatValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type FLOAT.");
}
/****************/
/* doubleValue: */
/****************/
public double doubleValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type FLOAT.");
}
/****************/
/* lexemeValue: */
/****************/
public String lexemeValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type LEXEME.");
}
/****************/
/* symbolValue: */
/****************/
public String symbolValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type SYMBOL.");
}
/****************/
/* stringValue: */
/****************/
public String stringValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type STRING.");
}
/**********************/
/* instanceNameValue: */
/**********************/
public String instanceNameValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not type INSTANCE NAME.");
}
/********************/
/* multifieldValue: */
/********************/
public List multifieldValue() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not multifield type.");
}
/********************/
/* get: */
/********************/
public PrimitiveValue get(
int index) throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not multifield type.");
}
/********************/
/* size: */
/********************/
public int size() throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not multifield type.");
}
/****************/
/* getFactSlot: */
/****************/
public PrimitiveValue getFactSlot(
String slotName) throws Exception
{
throw new Exception("PrimitiveValue " + this + " is not fact address type.");
}
/************/
/* retain: */
/************/
public void retain()
{
//System.out.println("PrimitiveValue retain");
}
/************/
/* release: */
/************/
public void release()
{
//System.out.println("PrimitiveValue release");
}
/*************/
/* toString: */
/*************/
public String toString()
{
if (theValue != null)
{ return theValue.toString(); }
return "";
}
}
| lgpl-3.0 |
CoFH/TabulaRasa | src/main/java/cofh/tabularasa/TabulaRasa.java | 2283 | package cofh.tabularasa;
import cofh.tabularasa.TRParser.TemplateTypes;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
import cpw.mods.fml.common.Mod.Instance;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import java.io.File;
import java.util.ArrayList;
import net.minecraft.block.Block;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fluids.BlockFluidBase;
import net.minecraftforge.fluids.Fluid;
@Mod(modid = TabulaRasa.modId, name = TabulaRasa.modName, version = TabulaRasa.version, dependencies = TabulaRasa.dependencies)
public class TabulaRasa {
public static final String modId = "TabulaRasa";
public static final String modName = "Tabula Rasa";
public static final String version = "1.7.10R1.1.0";
public static final String dependencies = "required-after:FML@[7.10.0.1151, 7.11);required-after:Forge@[10.13.0.1151, 10.14)";
@Instance("TabulaRasa")
public static TabulaRasa instance;
static File configDir;
Configuration config;
public static final CreativeTabs tab = new TRCreativeTab();
public static ArrayList<Item> items = new ArrayList<Item>();
public static ArrayList<Fluid> fluids = new ArrayList<Fluid>();
public static ArrayList<Block> blocks = new ArrayList<Block>();
public static ArrayList<BlockFluidBase> fluidBlocks = new ArrayList<BlockFluidBase>();
@EventHandler
public void preInit(FMLPreInitializationEvent event) {
configDir = event.getModConfigurationDirectory();
TRParser.initialize();
try {
TRParser.parseTemplateFiles();
TRParser.parseTemplates(TemplateTypes.ITEM);
TRParser.parseTemplates(TemplateTypes.FLUID);
TRParser.parseTemplates(TemplateTypes.BLOCK);
TRParser.parseTemplates(TemplateTypes.FLUIDBLOCK);
} catch (Throwable t) {
t.printStackTrace();
}
}
@EventHandler
public void initialize(FMLInitializationEvent event) {
}
@EventHandler
public void loadComplete(FMLLoadCompleteEvent event) {
try {
TRParser.parseTemplates(TemplateTypes.RECIPE);
} catch (Throwable t) {
t.printStackTrace();
}
}
}
| lgpl-3.0 |
Builders-SonarSource/sonarqube-bis | server/sonar-server/src/test/java/org/sonar/server/webhook/ws/WebhooksWsTest.java | 1839 | /*
* SonarQube
* Copyright (C) 2009-2016 SonarSource SA
* mailto:contact AT sonarsource DOT com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.sonar.server.webhook.ws;
import org.junit.Test;
import org.sonar.api.server.ws.WebService;
import org.sonar.db.DbClient;
import org.sonar.server.component.ComponentFinder;
import org.sonar.server.user.UserSession;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.mock;
public class WebhooksWsTest {
@Test
public void test_definition() {
WebhooksWsAction action = newFakeAction();
WebhooksWs underTest = new WebhooksWs(action);
WebService.Context context = new WebService.Context();
underTest.define(context);
WebService.Controller controller = context.controller("api/webhooks");
assertThat(controller).isNotNull();
assertThat(controller.description()).isNotEmpty();
assertThat(controller.since()).isEqualTo("6.2");
}
private static WebhooksWsAction newFakeAction() {
return new WebhookDeliveriesAction(mock(DbClient.class), mock(UserSession.class), mock(ComponentFinder.class));
}
}
| lgpl-3.0 |
sikachu/jasperreports | src/net/sf/jasperreports/engine/util/FlashUtils.java | 2578 | /*
* JasperReports - Free Java Reporting Library.
* Copyright (C) 2001 - 2013 Jaspersoft Corporation. All rights reserved.
* http://www.jaspersoft.com
*
* Unless you have purchased a commercial license agreement from Jaspersoft,
* the following license terms apply:
*
* This program is part of JasperReports.
*
* JasperReports is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* JasperReports is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with JasperReports. If not, see <http://www.gnu.org/licenses/>.
*/
package net.sf.jasperreports.engine.util;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import net.sf.jasperreports.engine.JRGenericPrintElement;
import net.sf.jasperreports.engine.JRPropertiesUtil;
import net.sf.jasperreports.engine.JRRuntimeException;
import net.sf.jasperreports.engine.export.FlashPrintElement;
import net.sf.jasperreports.engine.export.JRExporterContext;
/**
* Utility methods related to Flash objects.
*
* @author Lucian Chirita (lucianc@users.sourceforge.net)
* @version $Id: FlashUtils.java 5878 2013-01-07 20:23:13Z teodord $
*/
public class FlashUtils
{
/**
* Encodes a text used as Flash variable.
*
* @param text the text to encode
* @return the encoded text
*/
public static String encodeFlashVariable(String text)
{
try
{
// URL/percent encoding is used for FlashVars
// always using UTF-8 for now
return URLEncoder.encode(text, "UTF-8");
}
catch (UnsupportedEncodingException e)
{
// never
throw new JRRuntimeException(e);
}
}
/**
* Determines the allowScriptAccess parameter for a Flash element.
*
* @param context
* @param element
* @return the value of the allowScriptAccess parameter to use for the element
* @see FlashPrintElement#PROPERTY_ALLOW_SCRIPT_ACCESS
*/
public static String getAllowScriptAccess(
JRExporterContext context, JRGenericPrintElement element)
{
return JRPropertiesUtil.getInstance(context.getJasperReportsContext()).getProperty(FlashPrintElement.PROPERTY_ALLOW_SCRIPT_ACCESS,
element, context.getExportedReport());
}
}
| lgpl-3.0 |
yuripourre/keel | src/main/java/com/harium/keel/effect/helper/EffectHelper.java | 4165 | package com.harium.keel.effect.helper;
import com.harium.keel.core.helper.ColorHelper;
import com.harium.keel.core.source.ImageSource;
public class EffectHelper {
// No instances allowed
private EffectHelper() {
}
public static void setRGB(int index, int rgb, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
input.setRGB(x, y, rgb);
}
public static void setRGB(int index, int r, int g, int b, ImageSource input) {
int rgb = ColorHelper.getRGB(r, g, b);
int x = getX(index, input);
int y = getY(index, input);
input.setRGB(x, y, rgb);
}
public static void setRGB(int index, int r, int g, int b, int a, ImageSource input) {
int rgb = ColorHelper.getARGB(r, g, b, a);
int x = getX(index, input);
int y = getY(index, input);
input.setRGB(x, y, rgb);
}
public static void setRed(int index, int red, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
int rgb = input.getRGB(x, y);
int r = red;
int g = ColorHelper.getRed(rgb);
int b = ColorHelper.getBlue(rgb);
input.setRGB(x, y, ColorHelper.getRGB(r, g, b));
}
public static void setGreen(int index, int green, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
int rgb = input.getRGB(x, y);
int r = ColorHelper.getRed(rgb);
int g = green;
int b = ColorHelper.getBlue(rgb);
input.setRGB(x, y, ColorHelper.getRGB(r, g, b));
}
public static void setBlue(int index, int blue, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
int rgb = input.getRGB(x, y);
int r = ColorHelper.getRed(rgb);
int g = ColorHelper.getGreen(rgb);
int b = blue;
input.setRGB(x, y, ColorHelper.getRGB(r, g, b));
}
public static void setGray(int index, int gray, ImageSource input) {
setRGB(index, gray, input);
}
public static int getRed(int index, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
return input.getR(x, y);
}
public static int getGreen(int index, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
return input.getG(x, y);
}
public static int getBlue(int index, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
return input.getB(x, y);
}
public static int getAlpha(int index, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
return input.getA(x, y);
}
public static int getRGB(int index, ImageSource input) {
int x = getX(index, input);
int y = getY(index, input);
return input.getRGB(x, y);
}
public static int getGray(int index, ImageSource input) {
return getRGB(index, input);
}
public static int getY(int index, ImageSource overlay) {
return index / overlay.getWidth();
}
public static int getX(int index, ImageSource overlay) {
return index % overlay.getWidth();
}
public static int getSize(ImageSource input) {
return input.getWidth() * input.getHeight();
}
public static void setImage(ImageSource source, ImageSource destination) {
for (int i = 0; i < destination.getHeight(); i++) {
for (int j = 0; j < destination.getWidth(); j++) {
destination.setRGB(j, i, source.getRGB(j, i));
}
}
}
public static int[] getGrayData(ImageSource fastBitmap) {
int size = getSize(fastBitmap);
int[] grayData = new int[size];
if (fastBitmap.isGrayscale()) {
for (int i = 0; i < size; i++) {
grayData[i] = getRGB(i, fastBitmap);
}
} else {
for (int i = 0; i < size; i++) {
grayData[i] = getBlue(i, fastBitmap);
}
}
return grayData;
}
}
| lgpl-3.0 |
NOVA-Team/NOVA-Core | wrappers/minecraft/1.7.10/core-1.7.10/src/main/java/nova/core/wrapper/mc/forge/v1_7_10/wrapper/assets/NovaFileResourcePack.java | 4852 | /*
* Copyright (c) 2015 NOVA, All rights reserved.
* This library is free software, licensed under GNU Lesser General Public License version 3
*
* This file is part of NOVA.
*
* NOVA is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NOVA 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 NOVA. If not, see <http://www.gnu.org/licenses/>.
*/
package nova.core.wrapper.mc.forge.v1_7_10.wrapper.assets;
import com.google.common.base.Charsets;
import net.minecraft.client.resources.FileResourcePack;
import net.minecraft.util.ResourceLocation;
import nova.core.wrapper.mc.forge.v1_7_10.NovaMinecraftPreloader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Optional;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
public class NovaFileResourcePack extends FileResourcePack implements NovaResourcePack<ZipEntry> {
private static final Pattern LANG_PATTERN = Pattern.compile("^assets/([^/]+)/(lang/[a-zA-Z0-9-]+\\.lang)$", Pattern.CASE_INSENSITIVE);
private final String modid;
private final String[] domains;
private ZipFile resourcePackZipFile;
public NovaFileResourcePack(File file, String modid, String[] domains) {
super(file);
this.modid = modid;
this.domains = domains;
}
private ZipFile getResourcePackZipFile() throws IOException {
if (this.resourcePackZipFile == null) {
this.resourcePackZipFile = new ZipFile(this.resourcePackFile);
}
return this.resourcePackZipFile;
}
@Override
public Set<String> getResourceDomains() {
HashSet<String> domains = new HashSet<>();
domains.add(modid);
domains.addAll(Arrays.asList(this.domains));
return domains;
}
@Override
protected InputStream getInputStreamByName(String path) throws IOException {
path = transform(path);
try {
return getInputStreamCaseInsensitive(path);
} catch (IOException e) {
if (path.endsWith("sounds.json")) {
return new ByteArrayInputStream(NovaMinecraftPreloader.generateSoundJSON(this).getBytes(Charsets.UTF_8));
} else if ("pack.mcmeta".equalsIgnoreCase(path)) {
return new ByteArrayInputStream(NovaMinecraftPreloader.generatePackMcmeta().getBytes(Charsets.UTF_8));
} else {
if (path.endsWith(".mcmeta")) {
return new ByteArrayInputStream("{}".getBytes());
}
throw e;
}
}
}
@Override
public InputStream getInputStream(ResourceLocation rl) throws IOException {
return getInputStreamByName(transform(rl));
}
@Override
public boolean hasResourceName(String path) {
path = transform(path);
//Hack Sounds and McMeta
if (path.endsWith("sounds.json") || path.endsWith("pack.mcmeta")) {
return true;
}
return findFileCaseInsensitive(path).isPresent();
}
@Override
public boolean resourceExists(ResourceLocation rl) {
//Hack Sounds and McMeta
if (rl.getResourcePath().endsWith("sounds.json") || rl.getResourcePath().endsWith("pack.mcmeta")) {
return true;
}
return findFileCaseInsensitive(transform(rl)).isPresent();
}
@Override
public String getPackName() {
return NovaResourcePack.super.getPackName();
}
@Override
public String getID() {
return modid;
}
@Override
public Set<ResourceLocation> getLanguageFiles() {
try {
return getResourcePackZipFile().stream()
.map(e -> {
Matcher m = LANG_PATTERN.matcher(e.getName());
if (!m.matches())
return null;
return new ResourceLocation(m.group(1), m.group(2));
})
.filter(e -> e != null)
.collect(Collectors.toSet());
} catch (IOException ex) {
return Collections.emptySet();
}
}
@Override
public InputStream getInputStreamCaseInsensitive(String path) throws IOException {
Optional<ZipEntry> ze = findFileCaseInsensitive(transform(path));
if (ze.isPresent())
return getResourcePackZipFile().getInputStream(ze.get());
return super.getInputStreamByName(path);
}
@Override
public Optional<ZipEntry> findFileCaseInsensitive(String path) {
String p = transform(path);
try {
return getResourcePackZipFile().stream().filter(e -> e.getName().equalsIgnoreCase(p)).findFirst().map(e -> (ZipEntry) e);
} catch (IOException ex) {
return Optional.empty();
}
}
}
| lgpl-3.0 |
pedrohnog/Trabalhos-FIAP | Trabalho3/Netgifx/src/br/com/fiap/cache/builder/impl/CacheBuilderImpl.java | 4876 | package br.com.fiap.cache.builder.impl;
import br.com.fiap.cache.builder.CacheBuilder;
import br.com.fiap.cache.constants.TamanhoMemoria;
import br.com.fiap.cache.constants.TempoVida;
import br.com.fiap.cache.manager.GerenciadorCache;
import br.com.fiap.cache.vo.CacheVO;
import br.com.fiap.cache.vo.QuantidadeMaximaObjetoVO;
import br.com.fiap.cache.vo.TamanhoMaximoMemoriaVO;
import br.com.fiap.cache.vo.TamanhoMaximoObjetoVO;
import br.com.fiap.cache.vo.TempoVidaObjetoVO;
/**
*
* Classe responsável pela definição do construtor do cache
*
* @since 1.0.0
* @author Pedro Nogueira
* @version 1.0.0
*
*/
public class CacheBuilderImpl<K, V> implements CacheBuilder<K, V> {
private Class<K> tipoChave;
private Class<V> tipoValor;
private CacheVO cache;
/**
*
* Inicializador estático para o construtor
*
* @param <K> Tipo de objeto que será utilizado como chave
* @param <V> Tipo de objeto que será utilizado como valor
*
* @param tipoChave Classe que será utilizada como chave
* @param tipoValor Classe que será utilizada como valor
*
* @return A própria classe
*/
public static <K, V> CacheBuilderImpl<K, V> init(Class<K> tipoChave, Class<V> tipoValor) {
return new CacheBuilderImpl<>(tipoChave, tipoValor);
}
/**
*
* Construtor que receber os tipos que serão utilizados pelo cache
*
* @param tipoChave Classe que será utilizada como chave
* @param tipoValor Classe que será utilizada como valor
*/
private CacheBuilderImpl(Class<K> tipoChave, Class<V> tipoValor) {
this.tipoChave = tipoChave;
this.tipoValor = tipoValor;
this.cache = new CacheVO();
}
/**
*
* Método responsável por definir o tamanho máximo de memória que será utilizado por uma instância do cache
*
* @param valor Valor que será utilizado
* @param tamanhoMemoria Unidade de bytes que será utilizada
*
* @return A própria classe
*/
@Override
public CacheBuilder<K, V> definirTamanhoMaximoMemoria(Long valor, TamanhoMemoria tamanhoMemoria) {
TamanhoMaximoMemoriaVO tamanhoMaximoMemoria = new TamanhoMaximoMemoriaVO();
tamanhoMaximoMemoria.setTamanhoMaximoMemoria(valor);
tamanhoMaximoMemoria.setUnidadeTamanhoMemoria(tamanhoMemoria);
this.cache.setTamanhoMaximoMemoria(tamanhoMaximoMemoria);
return this;
}
/**
*
* Método responsável por definir o tamanho máximo de memória que cada objeto utilizará dentro do cache
*
* @param valor Valor que será utilizado
* @param tamanhoMemoria Unidade de bytes que será utilizada
*
* @return A própria classe
*/
@Override
public CacheBuilder<K, V> definirTamanhoMaximoObjeto(Long valor, TamanhoMemoria tamanhoMemoria) {
TamanhoMaximoObjetoVO tamanhoMaximoObjeto = new TamanhoMaximoObjetoVO();
tamanhoMaximoObjeto.setTamanhoMaximoObjeto(valor);
tamanhoMaximoObjeto.setUnidadeTamanhoMemoria(tamanhoMemoria);
this.cache.setTamanhoMaximoObjeto(tamanhoMaximoObjeto);
return this;
}
/**
*
* Define o tempo de um objeto no cache antes de expirar
*
* Se definido junto com o <code>definirTempoVidaNaoExpira</code> então o último à ser definido prevalecerá
*
* @param valor Valor que será utilizado
* @param tempoVida Unidade de tempo que será utilizada
*
* @return A própria classe
*/
@Override
public CacheBuilder<K, V> definirTempoVida(Long valor, TempoVida tempoVida) {
TempoVidaObjetoVO tempoVidaObjeto = new TempoVidaObjetoVO();
tempoVidaObjeto.setExpira(true);
tempoVidaObjeto.setTempoVidaObjeto(valor);
tempoVidaObjeto.setUnidadeTempoVida(tempoVida);
this.cache.setTempoVidaObjeto(tempoVidaObjeto);
return this;
}
/**
*
* Define que o objeto no cache não expira
*
* Se definido junto com o <code>definirTempoVida</code> então o último à ser definido prevalecerá
*
* @return A própria classe
*/
@Override
public CacheBuilder<K, V> definirTempoVidaNaoExpira() {
TempoVidaObjetoVO tempoVidaObjeto = new TempoVidaObjetoVO();
tempoVidaObjeto.setExpira(false);
this.cache.setTempoVidaObjeto(tempoVidaObjeto);
return this;
}
/**
*
* Define a quantidade máxima de objetos que será armazenada em uma instância do cache
*
* @param valor Valor que será utilizado
*
* @return A própria classe
*/
@Override
public CacheBuilder<K, V> definirQuantidadeMaximaObjetos(Long valor) {
QuantidadeMaximaObjetoVO quantidadeMaximaObjeto = new QuantidadeMaximaObjetoVO();
quantidadeMaximaObjeto.setQuantidadeMaximaObjetos(valor);
this.cache.setQuantidadeMaximaObjeto(quantidadeMaximaObjeto);
return this;
}
/**
*
* Inicializa o gerenciador de cache
*
* @param nomeCache Nome da instância que está sendo criada
*
* @return O gerenciador de cache
*/
@Override
public GerenciadorCache<K, V> build(String nomeCache) {
this.cache.setNomeCache(nomeCache);
return new GerenciadorCache<>(tipoChave, tipoValor, cache);
}
}
| unlicense |
rongshang/fbi-cbs2 | common/main/java/cbs/repository/account/billinfo/model/ActlgfExample.java | 87122 | package cbs.repository.account.billinfo.model;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class ActlgfExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public ActlgfExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andSysidtIsNull() {
addCriterion("SYSIDT is null");
return (Criteria) this;
}
public Criteria andSysidtIsNotNull() {
addCriterion("SYSIDT is not null");
return (Criteria) this;
}
public Criteria andSysidtEqualTo(String value) {
addCriterion("SYSIDT =", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtNotEqualTo(String value) {
addCriterion("SYSIDT <>", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtGreaterThan(String value) {
addCriterion("SYSIDT >", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtGreaterThanOrEqualTo(String value) {
addCriterion("SYSIDT >=", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtLessThan(String value) {
addCriterion("SYSIDT <", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtLessThanOrEqualTo(String value) {
addCriterion("SYSIDT <=", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtLike(String value) {
addCriterion("SYSIDT like", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtNotLike(String value) {
addCriterion("SYSIDT not like", value, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtIn(List<String> values) {
addCriterion("SYSIDT in", values, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtNotIn(List<String> values) {
addCriterion("SYSIDT not in", values, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtBetween(String value1, String value2) {
addCriterion("SYSIDT between", value1, value2, "sysidt");
return (Criteria) this;
}
public Criteria andSysidtNotBetween(String value1, String value2) {
addCriterion("SYSIDT not between", value1, value2, "sysidt");
return (Criteria) this;
}
public Criteria andOrgidtIsNull() {
addCriterion("ORGIDT is null");
return (Criteria) this;
}
public Criteria andOrgidtIsNotNull() {
addCriterion("ORGIDT is not null");
return (Criteria) this;
}
public Criteria andOrgidtEqualTo(String value) {
addCriterion("ORGIDT =", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtNotEqualTo(String value) {
addCriterion("ORGIDT <>", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtGreaterThan(String value) {
addCriterion("ORGIDT >", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtGreaterThanOrEqualTo(String value) {
addCriterion("ORGIDT >=", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtLessThan(String value) {
addCriterion("ORGIDT <", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtLessThanOrEqualTo(String value) {
addCriterion("ORGIDT <=", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtLike(String value) {
addCriterion("ORGIDT like", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtNotLike(String value) {
addCriterion("ORGIDT not like", value, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtIn(List<String> values) {
addCriterion("ORGIDT in", values, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtNotIn(List<String> values) {
addCriterion("ORGIDT not in", values, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtBetween(String value1, String value2) {
addCriterion("ORGIDT between", value1, value2, "orgidt");
return (Criteria) this;
}
public Criteria andOrgidtNotBetween(String value1, String value2) {
addCriterion("ORGIDT not between", value1, value2, "orgidt");
return (Criteria) this;
}
public Criteria andCusidtIsNull() {
addCriterion("CUSIDT is null");
return (Criteria) this;
}
public Criteria andCusidtIsNotNull() {
addCriterion("CUSIDT is not null");
return (Criteria) this;
}
public Criteria andCusidtEqualTo(String value) {
addCriterion("CUSIDT =", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtNotEqualTo(String value) {
addCriterion("CUSIDT <>", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtGreaterThan(String value) {
addCriterion("CUSIDT >", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtGreaterThanOrEqualTo(String value) {
addCriterion("CUSIDT >=", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtLessThan(String value) {
addCriterion("CUSIDT <", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtLessThanOrEqualTo(String value) {
addCriterion("CUSIDT <=", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtLike(String value) {
addCriterion("CUSIDT like", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtNotLike(String value) {
addCriterion("CUSIDT not like", value, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtIn(List<String> values) {
addCriterion("CUSIDT in", values, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtNotIn(List<String> values) {
addCriterion("CUSIDT not in", values, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtBetween(String value1, String value2) {
addCriterion("CUSIDT between", value1, value2, "cusidt");
return (Criteria) this;
}
public Criteria andCusidtNotBetween(String value1, String value2) {
addCriterion("CUSIDT not between", value1, value2, "cusidt");
return (Criteria) this;
}
public Criteria andApcodeIsNull() {
addCriterion("APCODE is null");
return (Criteria) this;
}
public Criteria andApcodeIsNotNull() {
addCriterion("APCODE is not null");
return (Criteria) this;
}
public Criteria andApcodeEqualTo(String value) {
addCriterion("APCODE =", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeNotEqualTo(String value) {
addCriterion("APCODE <>", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeGreaterThan(String value) {
addCriterion("APCODE >", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeGreaterThanOrEqualTo(String value) {
addCriterion("APCODE >=", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeLessThan(String value) {
addCriterion("APCODE <", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeLessThanOrEqualTo(String value) {
addCriterion("APCODE <=", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeLike(String value) {
addCriterion("APCODE like", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeNotLike(String value) {
addCriterion("APCODE not like", value, "apcode");
return (Criteria) this;
}
public Criteria andApcodeIn(List<String> values) {
addCriterion("APCODE in", values, "apcode");
return (Criteria) this;
}
public Criteria andApcodeNotIn(List<String> values) {
addCriterion("APCODE not in", values, "apcode");
return (Criteria) this;
}
public Criteria andApcodeBetween(String value1, String value2) {
addCriterion("APCODE between", value1, value2, "apcode");
return (Criteria) this;
}
public Criteria andApcodeNotBetween(String value1, String value2) {
addCriterion("APCODE not between", value1, value2, "apcode");
return (Criteria) this;
}
public Criteria andCurcdeIsNull() {
addCriterion("CURCDE is null");
return (Criteria) this;
}
public Criteria andCurcdeIsNotNull() {
addCriterion("CURCDE is not null");
return (Criteria) this;
}
public Criteria andCurcdeEqualTo(String value) {
addCriterion("CURCDE =", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeNotEqualTo(String value) {
addCriterion("CURCDE <>", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeGreaterThan(String value) {
addCriterion("CURCDE >", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeGreaterThanOrEqualTo(String value) {
addCriterion("CURCDE >=", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeLessThan(String value) {
addCriterion("CURCDE <", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeLessThanOrEqualTo(String value) {
addCriterion("CURCDE <=", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeLike(String value) {
addCriterion("CURCDE like", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeNotLike(String value) {
addCriterion("CURCDE not like", value, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeIn(List<String> values) {
addCriterion("CURCDE in", values, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeNotIn(List<String> values) {
addCriterion("CURCDE not in", values, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeBetween(String value1, String value2) {
addCriterion("CURCDE between", value1, value2, "curcde");
return (Criteria) this;
}
public Criteria andCurcdeNotBetween(String value1, String value2) {
addCriterion("CURCDE not between", value1, value2, "curcde");
return (Criteria) this;
}
public Criteria andLegpnyIsNull() {
addCriterion("LEGPNY is null");
return (Criteria) this;
}
public Criteria andLegpnyIsNotNull() {
addCriterion("LEGPNY is not null");
return (Criteria) this;
}
public Criteria andLegpnyEqualTo(Short value) {
addCriterion("LEGPNY =", value, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyNotEqualTo(Short value) {
addCriterion("LEGPNY <>", value, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyGreaterThan(Short value) {
addCriterion("LEGPNY >", value, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyGreaterThanOrEqualTo(Short value) {
addCriterion("LEGPNY >=", value, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyLessThan(Short value) {
addCriterion("LEGPNY <", value, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyLessThanOrEqualTo(Short value) {
addCriterion("LEGPNY <=", value, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyIn(List<Short> values) {
addCriterion("LEGPNY in", values, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyNotIn(List<Short> values) {
addCriterion("LEGPNY not in", values, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyBetween(Short value1, Short value2) {
addCriterion("LEGPNY between", value1, value2, "legpny");
return (Criteria) this;
}
public Criteria andLegpnyNotBetween(Short value1, Short value2) {
addCriterion("LEGPNY not between", value1, value2, "legpny");
return (Criteria) this;
}
public Criteria andNlegpgIsNull() {
addCriterion("NLEGPG is null");
return (Criteria) this;
}
public Criteria andNlegpgIsNotNull() {
addCriterion("NLEGPG is not null");
return (Criteria) this;
}
public Criteria andNlegpgEqualTo(Integer value) {
addCriterion("NLEGPG =", value, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgNotEqualTo(Integer value) {
addCriterion("NLEGPG <>", value, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgGreaterThan(Integer value) {
addCriterion("NLEGPG >", value, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgGreaterThanOrEqualTo(Integer value) {
addCriterion("NLEGPG >=", value, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgLessThan(Integer value) {
addCriterion("NLEGPG <", value, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgLessThanOrEqualTo(Integer value) {
addCriterion("NLEGPG <=", value, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgIn(List<Integer> values) {
addCriterion("NLEGPG in", values, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgNotIn(List<Integer> values) {
addCriterion("NLEGPG not in", values, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgBetween(Integer value1, Integer value2) {
addCriterion("NLEGPG between", value1, value2, "nlegpg");
return (Criteria) this;
}
public Criteria andNlegpgNotBetween(Integer value1, Integer value2) {
addCriterion("NLEGPG not between", value1, value2, "nlegpg");
return (Criteria) this;
}
public Criteria andPaglinIsNull() {
addCriterion("PAGLIN is null");
return (Criteria) this;
}
public Criteria andPaglinIsNotNull() {
addCriterion("PAGLIN is not null");
return (Criteria) this;
}
public Criteria andPaglinEqualTo(Short value) {
addCriterion("PAGLIN =", value, "paglin");
return (Criteria) this;
}
public Criteria andPaglinNotEqualTo(Short value) {
addCriterion("PAGLIN <>", value, "paglin");
return (Criteria) this;
}
public Criteria andPaglinGreaterThan(Short value) {
addCriterion("PAGLIN >", value, "paglin");
return (Criteria) this;
}
public Criteria andPaglinGreaterThanOrEqualTo(Short value) {
addCriterion("PAGLIN >=", value, "paglin");
return (Criteria) this;
}
public Criteria andPaglinLessThan(Short value) {
addCriterion("PAGLIN <", value, "paglin");
return (Criteria) this;
}
public Criteria andPaglinLessThanOrEqualTo(Short value) {
addCriterion("PAGLIN <=", value, "paglin");
return (Criteria) this;
}
public Criteria andPaglinIn(List<Short> values) {
addCriterion("PAGLIN in", values, "paglin");
return (Criteria) this;
}
public Criteria andPaglinNotIn(List<Short> values) {
addCriterion("PAGLIN not in", values, "paglin");
return (Criteria) this;
}
public Criteria andPaglinBetween(Short value1, Short value2) {
addCriterion("PAGLIN between", value1, value2, "paglin");
return (Criteria) this;
}
public Criteria andPaglinNotBetween(Short value1, Short value2) {
addCriterion("PAGLIN not between", value1, value2, "paglin");
return (Criteria) this;
}
public Criteria andFstpagIsNull() {
addCriterion("FSTPAG is null");
return (Criteria) this;
}
public Criteria andFstpagIsNotNull() {
addCriterion("FSTPAG is not null");
return (Criteria) this;
}
public Criteria andFstpagEqualTo(String value) {
addCriterion("FSTPAG =", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagNotEqualTo(String value) {
addCriterion("FSTPAG <>", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagGreaterThan(String value) {
addCriterion("FSTPAG >", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagGreaterThanOrEqualTo(String value) {
addCriterion("FSTPAG >=", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagLessThan(String value) {
addCriterion("FSTPAG <", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagLessThanOrEqualTo(String value) {
addCriterion("FSTPAG <=", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagLike(String value) {
addCriterion("FSTPAG like", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagNotLike(String value) {
addCriterion("FSTPAG not like", value, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagIn(List<String> values) {
addCriterion("FSTPAG in", values, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagNotIn(List<String> values) {
addCriterion("FSTPAG not in", values, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagBetween(String value1, String value2) {
addCriterion("FSTPAG between", value1, value2, "fstpag");
return (Criteria) this;
}
public Criteria andFstpagNotBetween(String value1, String value2) {
addCriterion("FSTPAG not between", value1, value2, "fstpag");
return (Criteria) this;
}
public Criteria andDayendIsNull() {
addCriterion("DAYEND is null");
return (Criteria) this;
}
public Criteria andDayendIsNotNull() {
addCriterion("DAYEND is not null");
return (Criteria) this;
}
public Criteria andDayendEqualTo(String value) {
addCriterion("DAYEND =", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendNotEqualTo(String value) {
addCriterion("DAYEND <>", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendGreaterThan(String value) {
addCriterion("DAYEND >", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendGreaterThanOrEqualTo(String value) {
addCriterion("DAYEND >=", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendLessThan(String value) {
addCriterion("DAYEND <", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendLessThanOrEqualTo(String value) {
addCriterion("DAYEND <=", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendLike(String value) {
addCriterion("DAYEND like", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendNotLike(String value) {
addCriterion("DAYEND not like", value, "dayend");
return (Criteria) this;
}
public Criteria andDayendIn(List<String> values) {
addCriterion("DAYEND in", values, "dayend");
return (Criteria) this;
}
public Criteria andDayendNotIn(List<String> values) {
addCriterion("DAYEND not in", values, "dayend");
return (Criteria) this;
}
public Criteria andDayendBetween(String value1, String value2) {
addCriterion("DAYEND between", value1, value2, "dayend");
return (Criteria) this;
}
public Criteria andDayendNotBetween(String value1, String value2) {
addCriterion("DAYEND not between", value1, value2, "dayend");
return (Criteria) this;
}
public Criteria andLegdepIsNull() {
addCriterion("LEGDEP is null");
return (Criteria) this;
}
public Criteria andLegdepIsNotNull() {
addCriterion("LEGDEP is not null");
return (Criteria) this;
}
public Criteria andLegdepEqualTo(String value) {
addCriterion("LEGDEP =", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepNotEqualTo(String value) {
addCriterion("LEGDEP <>", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepGreaterThan(String value) {
addCriterion("LEGDEP >", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepGreaterThanOrEqualTo(String value) {
addCriterion("LEGDEP >=", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepLessThan(String value) {
addCriterion("LEGDEP <", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepLessThanOrEqualTo(String value) {
addCriterion("LEGDEP <=", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepLike(String value) {
addCriterion("LEGDEP like", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepNotLike(String value) {
addCriterion("LEGDEP not like", value, "legdep");
return (Criteria) this;
}
public Criteria andLegdepIn(List<String> values) {
addCriterion("LEGDEP in", values, "legdep");
return (Criteria) this;
}
public Criteria andLegdepNotIn(List<String> values) {
addCriterion("LEGDEP not in", values, "legdep");
return (Criteria) this;
}
public Criteria andLegdepBetween(String value1, String value2) {
addCriterion("LEGDEP between", value1, value2, "legdep");
return (Criteria) this;
}
public Criteria andLegdepNotBetween(String value1, String value2) {
addCriterion("LEGDEP not between", value1, value2, "legdep");
return (Criteria) this;
}
public Criteria andLegdatIsNull() {
addCriterion("LEGDAT is null");
return (Criteria) this;
}
public Criteria andLegdatIsNotNull() {
addCriterion("LEGDAT is not null");
return (Criteria) this;
}
public Criteria andLegdatEqualTo(Date value) {
addCriterion("LEGDAT =", value, "legdat");
return (Criteria) this;
}
public Criteria andLegdatNotEqualTo(Date value) {
addCriterion("LEGDAT <>", value, "legdat");
return (Criteria) this;
}
public Criteria andLegdatGreaterThan(Date value) {
addCriterion("LEGDAT >", value, "legdat");
return (Criteria) this;
}
public Criteria andLegdatGreaterThanOrEqualTo(Date value) {
addCriterion("LEGDAT >=", value, "legdat");
return (Criteria) this;
}
public Criteria andLegdatLessThan(Date value) {
addCriterion("LEGDAT <", value, "legdat");
return (Criteria) this;
}
public Criteria andLegdatLessThanOrEqualTo(Date value) {
addCriterion("LEGDAT <=", value, "legdat");
return (Criteria) this;
}
public Criteria andLegdatIn(List<Date> values) {
addCriterion("LEGDAT in", values, "legdat");
return (Criteria) this;
}
public Criteria andLegdatNotIn(List<Date> values) {
addCriterion("LEGDAT not in", values, "legdat");
return (Criteria) this;
}
public Criteria andLegdatBetween(Date value1, Date value2) {
addCriterion("LEGDAT between", value1, value2, "legdat");
return (Criteria) this;
}
public Criteria andLegdatNotBetween(Date value1, Date value2) {
addCriterion("LEGDAT not between", value1, value2, "legdat");
return (Criteria) this;
}
public Criteria andLegtimIsNull() {
addCriterion("LEGTIM is null");
return (Criteria) this;
}
public Criteria andLegtimIsNotNull() {
addCriterion("LEGTIM is not null");
return (Criteria) this;
}
public Criteria andLegtimEqualTo(String value) {
addCriterion("LEGTIM =", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimNotEqualTo(String value) {
addCriterion("LEGTIM <>", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimGreaterThan(String value) {
addCriterion("LEGTIM >", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimGreaterThanOrEqualTo(String value) {
addCriterion("LEGTIM >=", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimLessThan(String value) {
addCriterion("LEGTIM <", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimLessThanOrEqualTo(String value) {
addCriterion("LEGTIM <=", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimLike(String value) {
addCriterion("LEGTIM like", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimNotLike(String value) {
addCriterion("LEGTIM not like", value, "legtim");
return (Criteria) this;
}
public Criteria andLegtimIn(List<String> values) {
addCriterion("LEGTIM in", values, "legtim");
return (Criteria) this;
}
public Criteria andLegtimNotIn(List<String> values) {
addCriterion("LEGTIM not in", values, "legtim");
return (Criteria) this;
}
public Criteria andLegtimBetween(String value1, String value2) {
addCriterion("LEGTIM between", value1, value2, "legtim");
return (Criteria) this;
}
public Criteria andLegtimNotBetween(String value1, String value2) {
addCriterion("LEGTIM not between", value1, value2, "legtim");
return (Criteria) this;
}
public Criteria andOrgid3IsNull() {
addCriterion("ORGID3 is null");
return (Criteria) this;
}
public Criteria andOrgid3IsNotNull() {
addCriterion("ORGID3 is not null");
return (Criteria) this;
}
public Criteria andOrgid3EqualTo(String value) {
addCriterion("ORGID3 =", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3NotEqualTo(String value) {
addCriterion("ORGID3 <>", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3GreaterThan(String value) {
addCriterion("ORGID3 >", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3GreaterThanOrEqualTo(String value) {
addCriterion("ORGID3 >=", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3LessThan(String value) {
addCriterion("ORGID3 <", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3LessThanOrEqualTo(String value) {
addCriterion("ORGID3 <=", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3Like(String value) {
addCriterion("ORGID3 like", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3NotLike(String value) {
addCriterion("ORGID3 not like", value, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3In(List<String> values) {
addCriterion("ORGID3 in", values, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3NotIn(List<String> values) {
addCriterion("ORGID3 not in", values, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3Between(String value1, String value2) {
addCriterion("ORGID3 between", value1, value2, "orgid3");
return (Criteria) this;
}
public Criteria andOrgid3NotBetween(String value1, String value2) {
addCriterion("ORGID3 not between", value1, value2, "orgid3");
return (Criteria) this;
}
public Criteria andTlrnumIsNull() {
addCriterion("TLRNUM is null");
return (Criteria) this;
}
public Criteria andTlrnumIsNotNull() {
addCriterion("TLRNUM is not null");
return (Criteria) this;
}
public Criteria andTlrnumEqualTo(String value) {
addCriterion("TLRNUM =", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumNotEqualTo(String value) {
addCriterion("TLRNUM <>", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumGreaterThan(String value) {
addCriterion("TLRNUM >", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumGreaterThanOrEqualTo(String value) {
addCriterion("TLRNUM >=", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumLessThan(String value) {
addCriterion("TLRNUM <", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumLessThanOrEqualTo(String value) {
addCriterion("TLRNUM <=", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumLike(String value) {
addCriterion("TLRNUM like", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumNotLike(String value) {
addCriterion("TLRNUM not like", value, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumIn(List<String> values) {
addCriterion("TLRNUM in", values, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumNotIn(List<String> values) {
addCriterion("TLRNUM not in", values, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumBetween(String value1, String value2) {
addCriterion("TLRNUM between", value1, value2, "tlrnum");
return (Criteria) this;
}
public Criteria andTlrnumNotBetween(String value1, String value2) {
addCriterion("TLRNUM not between", value1, value2, "tlrnum");
return (Criteria) this;
}
public Criteria andVchsetIsNull() {
addCriterion("VCHSET is null");
return (Criteria) this;
}
public Criteria andVchsetIsNotNull() {
addCriterion("VCHSET is not null");
return (Criteria) this;
}
public Criteria andVchsetEqualTo(Short value) {
addCriterion("VCHSET =", value, "vchset");
return (Criteria) this;
}
public Criteria andVchsetNotEqualTo(Short value) {
addCriterion("VCHSET <>", value, "vchset");
return (Criteria) this;
}
public Criteria andVchsetGreaterThan(Short value) {
addCriterion("VCHSET >", value, "vchset");
return (Criteria) this;
}
public Criteria andVchsetGreaterThanOrEqualTo(Short value) {
addCriterion("VCHSET >=", value, "vchset");
return (Criteria) this;
}
public Criteria andVchsetLessThan(Short value) {
addCriterion("VCHSET <", value, "vchset");
return (Criteria) this;
}
public Criteria andVchsetLessThanOrEqualTo(Short value) {
addCriterion("VCHSET <=", value, "vchset");
return (Criteria) this;
}
public Criteria andVchsetIn(List<Short> values) {
addCriterion("VCHSET in", values, "vchset");
return (Criteria) this;
}
public Criteria andVchsetNotIn(List<Short> values) {
addCriterion("VCHSET not in", values, "vchset");
return (Criteria) this;
}
public Criteria andVchsetBetween(Short value1, Short value2) {
addCriterion("VCHSET between", value1, value2, "vchset");
return (Criteria) this;
}
public Criteria andVchsetNotBetween(Short value1, Short value2) {
addCriterion("VCHSET not between", value1, value2, "vchset");
return (Criteria) this;
}
public Criteria andSetseqIsNull() {
addCriterion("SETSEQ is null");
return (Criteria) this;
}
public Criteria andSetseqIsNotNull() {
addCriterion("SETSEQ is not null");
return (Criteria) this;
}
public Criteria andSetseqEqualTo(Short value) {
addCriterion("SETSEQ =", value, "setseq");
return (Criteria) this;
}
public Criteria andSetseqNotEqualTo(Short value) {
addCriterion("SETSEQ <>", value, "setseq");
return (Criteria) this;
}
public Criteria andSetseqGreaterThan(Short value) {
addCriterion("SETSEQ >", value, "setseq");
return (Criteria) this;
}
public Criteria andSetseqGreaterThanOrEqualTo(Short value) {
addCriterion("SETSEQ >=", value, "setseq");
return (Criteria) this;
}
public Criteria andSetseqLessThan(Short value) {
addCriterion("SETSEQ <", value, "setseq");
return (Criteria) this;
}
public Criteria andSetseqLessThanOrEqualTo(Short value) {
addCriterion("SETSEQ <=", value, "setseq");
return (Criteria) this;
}
public Criteria andSetseqIn(List<Short> values) {
addCriterion("SETSEQ in", values, "setseq");
return (Criteria) this;
}
public Criteria andSetseqNotIn(List<Short> values) {
addCriterion("SETSEQ not in", values, "setseq");
return (Criteria) this;
}
public Criteria andSetseqBetween(Short value1, Short value2) {
addCriterion("SETSEQ between", value1, value2, "setseq");
return (Criteria) this;
}
public Criteria andSetseqNotBetween(Short value1, Short value2) {
addCriterion("SETSEQ not between", value1, value2, "setseq");
return (Criteria) this;
}
public Criteria andSecccyIsNull() {
addCriterion("SECCCY is null");
return (Criteria) this;
}
public Criteria andSecccyIsNotNull() {
addCriterion("SECCCY is not null");
return (Criteria) this;
}
public Criteria andSecccyEqualTo(String value) {
addCriterion("SECCCY =", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyNotEqualTo(String value) {
addCriterion("SECCCY <>", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyGreaterThan(String value) {
addCriterion("SECCCY >", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyGreaterThanOrEqualTo(String value) {
addCriterion("SECCCY >=", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyLessThan(String value) {
addCriterion("SECCCY <", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyLessThanOrEqualTo(String value) {
addCriterion("SECCCY <=", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyLike(String value) {
addCriterion("SECCCY like", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyNotLike(String value) {
addCriterion("SECCCY not like", value, "secccy");
return (Criteria) this;
}
public Criteria andSecccyIn(List<String> values) {
addCriterion("SECCCY in", values, "secccy");
return (Criteria) this;
}
public Criteria andSecccyNotIn(List<String> values) {
addCriterion("SECCCY not in", values, "secccy");
return (Criteria) this;
}
public Criteria andSecccyBetween(String value1, String value2) {
addCriterion("SECCCY between", value1, value2, "secccy");
return (Criteria) this;
}
public Criteria andSecccyNotBetween(String value1, String value2) {
addCriterion("SECCCY not between", value1, value2, "secccy");
return (Criteria) this;
}
public Criteria andDraccmIsNull() {
addCriterion("DRACCM is null");
return (Criteria) this;
}
public Criteria andDraccmIsNotNull() {
addCriterion("DRACCM is not null");
return (Criteria) this;
}
public Criteria andDraccmEqualTo(Long value) {
addCriterion("DRACCM =", value, "draccm");
return (Criteria) this;
}
public Criteria andDraccmNotEqualTo(Long value) {
addCriterion("DRACCM <>", value, "draccm");
return (Criteria) this;
}
public Criteria andDraccmGreaterThan(Long value) {
addCriterion("DRACCM >", value, "draccm");
return (Criteria) this;
}
public Criteria andDraccmGreaterThanOrEqualTo(Long value) {
addCriterion("DRACCM >=", value, "draccm");
return (Criteria) this;
}
public Criteria andDraccmLessThan(Long value) {
addCriterion("DRACCM <", value, "draccm");
return (Criteria) this;
}
public Criteria andDraccmLessThanOrEqualTo(Long value) {
addCriterion("DRACCM <=", value, "draccm");
return (Criteria) this;
}
public Criteria andDraccmIn(List<Long> values) {
addCriterion("DRACCM in", values, "draccm");
return (Criteria) this;
}
public Criteria andDraccmNotIn(List<Long> values) {
addCriterion("DRACCM not in", values, "draccm");
return (Criteria) this;
}
public Criteria andDraccmBetween(Long value1, Long value2) {
addCriterion("DRACCM between", value1, value2, "draccm");
return (Criteria) this;
}
public Criteria andDraccmNotBetween(Long value1, Long value2) {
addCriterion("DRACCM not between", value1, value2, "draccm");
return (Criteria) this;
}
public Criteria andCraccmIsNull() {
addCriterion("CRACCM is null");
return (Criteria) this;
}
public Criteria andCraccmIsNotNull() {
addCriterion("CRACCM is not null");
return (Criteria) this;
}
public Criteria andCraccmEqualTo(Long value) {
addCriterion("CRACCM =", value, "craccm");
return (Criteria) this;
}
public Criteria andCraccmNotEqualTo(Long value) {
addCriterion("CRACCM <>", value, "craccm");
return (Criteria) this;
}
public Criteria andCraccmGreaterThan(Long value) {
addCriterion("CRACCM >", value, "craccm");
return (Criteria) this;
}
public Criteria andCraccmGreaterThanOrEqualTo(Long value) {
addCriterion("CRACCM >=", value, "craccm");
return (Criteria) this;
}
public Criteria andCraccmLessThan(Long value) {
addCriterion("CRACCM <", value, "craccm");
return (Criteria) this;
}
public Criteria andCraccmLessThanOrEqualTo(Long value) {
addCriterion("CRACCM <=", value, "craccm");
return (Criteria) this;
}
public Criteria andCraccmIn(List<Long> values) {
addCriterion("CRACCM in", values, "craccm");
return (Criteria) this;
}
public Criteria andCraccmNotIn(List<Long> values) {
addCriterion("CRACCM not in", values, "craccm");
return (Criteria) this;
}
public Criteria andCraccmBetween(Long value1, Long value2) {
addCriterion("CRACCM between", value1, value2, "craccm");
return (Criteria) this;
}
public Criteria andCraccmNotBetween(Long value1, Long value2) {
addCriterion("CRACCM not between", value1, value2, "craccm");
return (Criteria) this;
}
public Criteria andTxnamtIsNull() {
addCriterion("TXNAMT is null");
return (Criteria) this;
}
public Criteria andTxnamtIsNotNull() {
addCriterion("TXNAMT is not null");
return (Criteria) this;
}
public Criteria andTxnamtEqualTo(Long value) {
addCriterion("TXNAMT =", value, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtNotEqualTo(Long value) {
addCriterion("TXNAMT <>", value, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtGreaterThan(Long value) {
addCriterion("TXNAMT >", value, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtGreaterThanOrEqualTo(Long value) {
addCriterion("TXNAMT >=", value, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtLessThan(Long value) {
addCriterion("TXNAMT <", value, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtLessThanOrEqualTo(Long value) {
addCriterion("TXNAMT <=", value, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtIn(List<Long> values) {
addCriterion("TXNAMT in", values, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtNotIn(List<Long> values) {
addCriterion("TXNAMT not in", values, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtBetween(Long value1, Long value2) {
addCriterion("TXNAMT between", value1, value2, "txnamt");
return (Criteria) this;
}
public Criteria andTxnamtNotBetween(Long value1, Long value2) {
addCriterion("TXNAMT not between", value1, value2, "txnamt");
return (Criteria) this;
}
public Criteria andActbalIsNull() {
addCriterion("ACTBAL is null");
return (Criteria) this;
}
public Criteria andActbalIsNotNull() {
addCriterion("ACTBAL is not null");
return (Criteria) this;
}
public Criteria andActbalEqualTo(Long value) {
addCriterion("ACTBAL =", value, "actbal");
return (Criteria) this;
}
public Criteria andActbalNotEqualTo(Long value) {
addCriterion("ACTBAL <>", value, "actbal");
return (Criteria) this;
}
public Criteria andActbalGreaterThan(Long value) {
addCriterion("ACTBAL >", value, "actbal");
return (Criteria) this;
}
public Criteria andActbalGreaterThanOrEqualTo(Long value) {
addCriterion("ACTBAL >=", value, "actbal");
return (Criteria) this;
}
public Criteria andActbalLessThan(Long value) {
addCriterion("ACTBAL <", value, "actbal");
return (Criteria) this;
}
public Criteria andActbalLessThanOrEqualTo(Long value) {
addCriterion("ACTBAL <=", value, "actbal");
return (Criteria) this;
}
public Criteria andActbalIn(List<Long> values) {
addCriterion("ACTBAL in", values, "actbal");
return (Criteria) this;
}
public Criteria andActbalNotIn(List<Long> values) {
addCriterion("ACTBAL not in", values, "actbal");
return (Criteria) this;
}
public Criteria andActbalBetween(Long value1, Long value2) {
addCriterion("ACTBAL between", value1, value2, "actbal");
return (Criteria) this;
}
public Criteria andActbalNotBetween(Long value1, Long value2) {
addCriterion("ACTBAL not between", value1, value2, "actbal");
return (Criteria) this;
}
public Criteria andLasbalIsNull() {
addCriterion("LASBAL is null");
return (Criteria) this;
}
public Criteria andLasbalIsNotNull() {
addCriterion("LASBAL is not null");
return (Criteria) this;
}
public Criteria andLasbalEqualTo(Long value) {
addCriterion("LASBAL =", value, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalNotEqualTo(Long value) {
addCriterion("LASBAL <>", value, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalGreaterThan(Long value) {
addCriterion("LASBAL >", value, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalGreaterThanOrEqualTo(Long value) {
addCriterion("LASBAL >=", value, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalLessThan(Long value) {
addCriterion("LASBAL <", value, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalLessThanOrEqualTo(Long value) {
addCriterion("LASBAL <=", value, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalIn(List<Long> values) {
addCriterion("LASBAL in", values, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalNotIn(List<Long> values) {
addCriterion("LASBAL not in", values, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalBetween(Long value1, Long value2) {
addCriterion("LASBAL between", value1, value2, "lasbal");
return (Criteria) this;
}
public Criteria andLasbalNotBetween(Long value1, Long value2) {
addCriterion("LASBAL not between", value1, value2, "lasbal");
return (Criteria) this;
}
public Criteria andValdatIsNull() {
addCriterion("VALDAT is null");
return (Criteria) this;
}
public Criteria andValdatIsNotNull() {
addCriterion("VALDAT is not null");
return (Criteria) this;
}
public Criteria andValdatEqualTo(Date value) {
addCriterion("VALDAT =", value, "valdat");
return (Criteria) this;
}
public Criteria andValdatNotEqualTo(Date value) {
addCriterion("VALDAT <>", value, "valdat");
return (Criteria) this;
}
public Criteria andValdatGreaterThan(Date value) {
addCriterion("VALDAT >", value, "valdat");
return (Criteria) this;
}
public Criteria andValdatGreaterThanOrEqualTo(Date value) {
addCriterion("VALDAT >=", value, "valdat");
return (Criteria) this;
}
public Criteria andValdatLessThan(Date value) {
addCriterion("VALDAT <", value, "valdat");
return (Criteria) this;
}
public Criteria andValdatLessThanOrEqualTo(Date value) {
addCriterion("VALDAT <=", value, "valdat");
return (Criteria) this;
}
public Criteria andValdatIn(List<Date> values) {
addCriterion("VALDAT in", values, "valdat");
return (Criteria) this;
}
public Criteria andValdatNotIn(List<Date> values) {
addCriterion("VALDAT not in", values, "valdat");
return (Criteria) this;
}
public Criteria andValdatBetween(Date value1, Date value2) {
addCriterion("VALDAT between", value1, value2, "valdat");
return (Criteria) this;
}
public Criteria andValdatNotBetween(Date value1, Date value2) {
addCriterion("VALDAT not between", value1, value2, "valdat");
return (Criteria) this;
}
public Criteria andRvslblIsNull() {
addCriterion("RVSLBL is null");
return (Criteria) this;
}
public Criteria andRvslblIsNotNull() {
addCriterion("RVSLBL is not null");
return (Criteria) this;
}
public Criteria andRvslblEqualTo(String value) {
addCriterion("RVSLBL =", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblNotEqualTo(String value) {
addCriterion("RVSLBL <>", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblGreaterThan(String value) {
addCriterion("RVSLBL >", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblGreaterThanOrEqualTo(String value) {
addCriterion("RVSLBL >=", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblLessThan(String value) {
addCriterion("RVSLBL <", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblLessThanOrEqualTo(String value) {
addCriterion("RVSLBL <=", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblLike(String value) {
addCriterion("RVSLBL like", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblNotLike(String value) {
addCriterion("RVSLBL not like", value, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblIn(List<String> values) {
addCriterion("RVSLBL in", values, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblNotIn(List<String> values) {
addCriterion("RVSLBL not in", values, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblBetween(String value1, String value2) {
addCriterion("RVSLBL between", value1, value2, "rvslbl");
return (Criteria) this;
}
public Criteria andRvslblNotBetween(String value1, String value2) {
addCriterion("RVSLBL not between", value1, value2, "rvslbl");
return (Criteria) this;
}
public Criteria andOrgid2IsNull() {
addCriterion("ORGID2 is null");
return (Criteria) this;
}
public Criteria andOrgid2IsNotNull() {
addCriterion("ORGID2 is not null");
return (Criteria) this;
}
public Criteria andOrgid2EqualTo(String value) {
addCriterion("ORGID2 =", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2NotEqualTo(String value) {
addCriterion("ORGID2 <>", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2GreaterThan(String value) {
addCriterion("ORGID2 >", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2GreaterThanOrEqualTo(String value) {
addCriterion("ORGID2 >=", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2LessThan(String value) {
addCriterion("ORGID2 <", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2LessThanOrEqualTo(String value) {
addCriterion("ORGID2 <=", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2Like(String value) {
addCriterion("ORGID2 like", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2NotLike(String value) {
addCriterion("ORGID2 not like", value, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2In(List<String> values) {
addCriterion("ORGID2 in", values, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2NotIn(List<String> values) {
addCriterion("ORGID2 not in", values, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2Between(String value1, String value2) {
addCriterion("ORGID2 between", value1, value2, "orgid2");
return (Criteria) this;
}
public Criteria andOrgid2NotBetween(String value1, String value2) {
addCriterion("ORGID2 not between", value1, value2, "orgid2");
return (Criteria) this;
}
public Criteria andPrdcdeIsNull() {
addCriterion("PRDCDE is null");
return (Criteria) this;
}
public Criteria andPrdcdeIsNotNull() {
addCriterion("PRDCDE is not null");
return (Criteria) this;
}
public Criteria andPrdcdeEqualTo(String value) {
addCriterion("PRDCDE =", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeNotEqualTo(String value) {
addCriterion("PRDCDE <>", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeGreaterThan(String value) {
addCriterion("PRDCDE >", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeGreaterThanOrEqualTo(String value) {
addCriterion("PRDCDE >=", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeLessThan(String value) {
addCriterion("PRDCDE <", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeLessThanOrEqualTo(String value) {
addCriterion("PRDCDE <=", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeLike(String value) {
addCriterion("PRDCDE like", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeNotLike(String value) {
addCriterion("PRDCDE not like", value, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeIn(List<String> values) {
addCriterion("PRDCDE in", values, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeNotIn(List<String> values) {
addCriterion("PRDCDE not in", values, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeBetween(String value1, String value2) {
addCriterion("PRDCDE between", value1, value2, "prdcde");
return (Criteria) this;
}
public Criteria andPrdcdeNotBetween(String value1, String value2) {
addCriterion("PRDCDE not between", value1, value2, "prdcde");
return (Criteria) this;
}
public Criteria andCrnyerIsNull() {
addCriterion("CRNYER is null");
return (Criteria) this;
}
public Criteria andCrnyerIsNotNull() {
addCriterion("CRNYER is not null");
return (Criteria) this;
}
public Criteria andCrnyerEqualTo(Short value) {
addCriterion("CRNYER =", value, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerNotEqualTo(Short value) {
addCriterion("CRNYER <>", value, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerGreaterThan(Short value) {
addCriterion("CRNYER >", value, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerGreaterThanOrEqualTo(Short value) {
addCriterion("CRNYER >=", value, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerLessThan(Short value) {
addCriterion("CRNYER <", value, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerLessThanOrEqualTo(Short value) {
addCriterion("CRNYER <=", value, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerIn(List<Short> values) {
addCriterion("CRNYER in", values, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerNotIn(List<Short> values) {
addCriterion("CRNYER not in", values, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerBetween(Short value1, Short value2) {
addCriterion("CRNYER between", value1, value2, "crnyer");
return (Criteria) this;
}
public Criteria andCrnyerNotBetween(Short value1, Short value2) {
addCriterion("CRNYER not between", value1, value2, "crnyer");
return (Criteria) this;
}
public Criteria andPrdseqIsNull() {
addCriterion("PRDSEQ is null");
return (Criteria) this;
}
public Criteria andPrdseqIsNotNull() {
addCriterion("PRDSEQ is not null");
return (Criteria) this;
}
public Criteria andPrdseqEqualTo(Integer value) {
addCriterion("PRDSEQ =", value, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqNotEqualTo(Integer value) {
addCriterion("PRDSEQ <>", value, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqGreaterThan(Integer value) {
addCriterion("PRDSEQ >", value, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqGreaterThanOrEqualTo(Integer value) {
addCriterion("PRDSEQ >=", value, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqLessThan(Integer value) {
addCriterion("PRDSEQ <", value, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqLessThanOrEqualTo(Integer value) {
addCriterion("PRDSEQ <=", value, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqIn(List<Integer> values) {
addCriterion("PRDSEQ in", values, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqNotIn(List<Integer> values) {
addCriterion("PRDSEQ not in", values, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqBetween(Integer value1, Integer value2) {
addCriterion("PRDSEQ between", value1, value2, "prdseq");
return (Criteria) this;
}
public Criteria andPrdseqNotBetween(Integer value1, Integer value2) {
addCriterion("PRDSEQ not between", value1, value2, "prdseq");
return (Criteria) this;
}
public Criteria andFillerIsNull() {
addCriterion("FILLER is null");
return (Criteria) this;
}
public Criteria andFillerIsNotNull() {
addCriterion("FILLER is not null");
return (Criteria) this;
}
public Criteria andFillerEqualTo(String value) {
addCriterion("FILLER =", value, "filler");
return (Criteria) this;
}
public Criteria andFillerNotEqualTo(String value) {
addCriterion("FILLER <>", value, "filler");
return (Criteria) this;
}
public Criteria andFillerGreaterThan(String value) {
addCriterion("FILLER >", value, "filler");
return (Criteria) this;
}
public Criteria andFillerGreaterThanOrEqualTo(String value) {
addCriterion("FILLER >=", value, "filler");
return (Criteria) this;
}
public Criteria andFillerLessThan(String value) {
addCriterion("FILLER <", value, "filler");
return (Criteria) this;
}
public Criteria andFillerLessThanOrEqualTo(String value) {
addCriterion("FILLER <=", value, "filler");
return (Criteria) this;
}
public Criteria andFillerLike(String value) {
addCriterion("FILLER like", value, "filler");
return (Criteria) this;
}
public Criteria andFillerNotLike(String value) {
addCriterion("FILLER not like", value, "filler");
return (Criteria) this;
}
public Criteria andFillerIn(List<String> values) {
addCriterion("FILLER in", values, "filler");
return (Criteria) this;
}
public Criteria andFillerNotIn(List<String> values) {
addCriterion("FILLER not in", values, "filler");
return (Criteria) this;
}
public Criteria andFillerBetween(String value1, String value2) {
addCriterion("FILLER between", value1, value2, "filler");
return (Criteria) this;
}
public Criteria andFillerNotBetween(String value1, String value2) {
addCriterion("FILLER not between", value1, value2, "filler");
return (Criteria) this;
}
public Criteria andThrrefIsNull() {
addCriterion("THRREF is null");
return (Criteria) this;
}
public Criteria andThrrefIsNotNull() {
addCriterion("THRREF is not null");
return (Criteria) this;
}
public Criteria andThrrefEqualTo(String value) {
addCriterion("THRREF =", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefNotEqualTo(String value) {
addCriterion("THRREF <>", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefGreaterThan(String value) {
addCriterion("THRREF >", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefGreaterThanOrEqualTo(String value) {
addCriterion("THRREF >=", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefLessThan(String value) {
addCriterion("THRREF <", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefLessThanOrEqualTo(String value) {
addCriterion("THRREF <=", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefLike(String value) {
addCriterion("THRREF like", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefNotLike(String value) {
addCriterion("THRREF not like", value, "thrref");
return (Criteria) this;
}
public Criteria andThrrefIn(List<String> values) {
addCriterion("THRREF in", values, "thrref");
return (Criteria) this;
}
public Criteria andThrrefNotIn(List<String> values) {
addCriterion("THRREF not in", values, "thrref");
return (Criteria) this;
}
public Criteria andThrrefBetween(String value1, String value2) {
addCriterion("THRREF between", value1, value2, "thrref");
return (Criteria) this;
}
public Criteria andThrrefNotBetween(String value1, String value2) {
addCriterion("THRREF not between", value1, value2, "thrref");
return (Criteria) this;
}
public Criteria andFurinfIsNull() {
addCriterion("FURINF is null");
return (Criteria) this;
}
public Criteria andFurinfIsNotNull() {
addCriterion("FURINF is not null");
return (Criteria) this;
}
public Criteria andFurinfEqualTo(String value) {
addCriterion("FURINF =", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfNotEqualTo(String value) {
addCriterion("FURINF <>", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfGreaterThan(String value) {
addCriterion("FURINF >", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfGreaterThanOrEqualTo(String value) {
addCriterion("FURINF >=", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfLessThan(String value) {
addCriterion("FURINF <", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfLessThanOrEqualTo(String value) {
addCriterion("FURINF <=", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfLike(String value) {
addCriterion("FURINF like", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfNotLike(String value) {
addCriterion("FURINF not like", value, "furinf");
return (Criteria) this;
}
public Criteria andFurinfIn(List<String> values) {
addCriterion("FURINF in", values, "furinf");
return (Criteria) this;
}
public Criteria andFurinfNotIn(List<String> values) {
addCriterion("FURINF not in", values, "furinf");
return (Criteria) this;
}
public Criteria andFurinfBetween(String value1, String value2) {
addCriterion("FURINF between", value1, value2, "furinf");
return (Criteria) this;
}
public Criteria andFurinfNotBetween(String value1, String value2) {
addCriterion("FURINF not between", value1, value2, "furinf");
return (Criteria) this;
}
public Criteria andFxrateIsNull() {
addCriterion("FXRATE is null");
return (Criteria) this;
}
public Criteria andFxrateIsNotNull() {
addCriterion("FXRATE is not null");
return (Criteria) this;
}
public Criteria andFxrateEqualTo(BigDecimal value) {
addCriterion("FXRATE =", value, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateNotEqualTo(BigDecimal value) {
addCriterion("FXRATE <>", value, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateGreaterThan(BigDecimal value) {
addCriterion("FXRATE >", value, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateGreaterThanOrEqualTo(BigDecimal value) {
addCriterion("FXRATE >=", value, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateLessThan(BigDecimal value) {
addCriterion("FXRATE <", value, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateLessThanOrEqualTo(BigDecimal value) {
addCriterion("FXRATE <=", value, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateIn(List<BigDecimal> values) {
addCriterion("FXRATE in", values, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateNotIn(List<BigDecimal> values) {
addCriterion("FXRATE not in", values, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("FXRATE between", value1, value2, "fxrate");
return (Criteria) this;
}
public Criteria andFxrateNotBetween(BigDecimal value1, BigDecimal value2) {
addCriterion("FXRATE not between", value1, value2, "fxrate");
return (Criteria) this;
}
public Criteria andSecpmtIsNull() {
addCriterion("SECPMT is null");
return (Criteria) this;
}
public Criteria andSecpmtIsNotNull() {
addCriterion("SECPMT is not null");
return (Criteria) this;
}
public Criteria andSecpmtEqualTo(Long value) {
addCriterion("SECPMT =", value, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtNotEqualTo(Long value) {
addCriterion("SECPMT <>", value, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtGreaterThan(Long value) {
addCriterion("SECPMT >", value, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtGreaterThanOrEqualTo(Long value) {
addCriterion("SECPMT >=", value, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtLessThan(Long value) {
addCriterion("SECPMT <", value, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtLessThanOrEqualTo(Long value) {
addCriterion("SECPMT <=", value, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtIn(List<Long> values) {
addCriterion("SECPMT in", values, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtNotIn(List<Long> values) {
addCriterion("SECPMT not in", values, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtBetween(Long value1, Long value2) {
addCriterion("SECPMT between", value1, value2, "secpmt");
return (Criteria) this;
}
public Criteria andSecpmtNotBetween(Long value1, Long value2) {
addCriterion("SECPMT not between", value1, value2, "secpmt");
return (Criteria) this;
}
public Criteria andSecbalIsNull() {
addCriterion("SECBAL is null");
return (Criteria) this;
}
public Criteria andSecbalIsNotNull() {
addCriterion("SECBAL is not null");
return (Criteria) this;
}
public Criteria andSecbalEqualTo(Long value) {
addCriterion("SECBAL =", value, "secbal");
return (Criteria) this;
}
public Criteria andSecbalNotEqualTo(Long value) {
addCriterion("SECBAL <>", value, "secbal");
return (Criteria) this;
}
public Criteria andSecbalGreaterThan(Long value) {
addCriterion("SECBAL >", value, "secbal");
return (Criteria) this;
}
public Criteria andSecbalGreaterThanOrEqualTo(Long value) {
addCriterion("SECBAL >=", value, "secbal");
return (Criteria) this;
}
public Criteria andSecbalLessThan(Long value) {
addCriterion("SECBAL <", value, "secbal");
return (Criteria) this;
}
public Criteria andSecbalLessThanOrEqualTo(Long value) {
addCriterion("SECBAL <=", value, "secbal");
return (Criteria) this;
}
public Criteria andSecbalIn(List<Long> values) {
addCriterion("SECBAL in", values, "secbal");
return (Criteria) this;
}
public Criteria andSecbalNotIn(List<Long> values) {
addCriterion("SECBAL not in", values, "secbal");
return (Criteria) this;
}
public Criteria andSecbalBetween(Long value1, Long value2) {
addCriterion("SECBAL between", value1, value2, "secbal");
return (Criteria) this;
}
public Criteria andSecbalNotBetween(Long value1, Long value2) {
addCriterion("SECBAL not between", value1, value2, "secbal");
return (Criteria) this;
}
public Criteria andSeclbaIsNull() {
addCriterion("SECLBA is null");
return (Criteria) this;
}
public Criteria andSeclbaIsNotNull() {
addCriterion("SECLBA is not null");
return (Criteria) this;
}
public Criteria andSeclbaEqualTo(Long value) {
addCriterion("SECLBA =", value, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaNotEqualTo(Long value) {
addCriterion("SECLBA <>", value, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaGreaterThan(Long value) {
addCriterion("SECLBA >", value, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaGreaterThanOrEqualTo(Long value) {
addCriterion("SECLBA >=", value, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaLessThan(Long value) {
addCriterion("SECLBA <", value, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaLessThanOrEqualTo(Long value) {
addCriterion("SECLBA <=", value, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaIn(List<Long> values) {
addCriterion("SECLBA in", values, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaNotIn(List<Long> values) {
addCriterion("SECLBA not in", values, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaBetween(Long value1, Long value2) {
addCriterion("SECLBA between", value1, value2, "seclba");
return (Criteria) this;
}
public Criteria andSeclbaNotBetween(Long value1, Long value2) {
addCriterion("SECLBA not between", value1, value2, "seclba");
return (Criteria) this;
}
public Criteria andRecstsIsNull() {
addCriterion("RECSTS is null");
return (Criteria) this;
}
public Criteria andRecstsIsNotNull() {
addCriterion("RECSTS is not null");
return (Criteria) this;
}
public Criteria andRecstsEqualTo(String value) {
addCriterion("RECSTS =", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsNotEqualTo(String value) {
addCriterion("RECSTS <>", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsGreaterThan(String value) {
addCriterion("RECSTS >", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsGreaterThanOrEqualTo(String value) {
addCriterion("RECSTS >=", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsLessThan(String value) {
addCriterion("RECSTS <", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsLessThanOrEqualTo(String value) {
addCriterion("RECSTS <=", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsLike(String value) {
addCriterion("RECSTS like", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsNotLike(String value) {
addCriterion("RECSTS not like", value, "recsts");
return (Criteria) this;
}
public Criteria andRecstsIn(List<String> values) {
addCriterion("RECSTS in", values, "recsts");
return (Criteria) this;
}
public Criteria andRecstsNotIn(List<String> values) {
addCriterion("RECSTS not in", values, "recsts");
return (Criteria) this;
}
public Criteria andRecstsBetween(String value1, String value2) {
addCriterion("RECSTS between", value1, value2, "recsts");
return (Criteria) this;
}
public Criteria andRecstsNotBetween(String value1, String value2) {
addCriterion("RECSTS not between", value1, value2, "recsts");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table ACTLGF
*
* @mbggenerated do_not_delete_during_merge Wed Mar 02 17:20:04 CST 2011
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table ACTLGF
*
* @mbggenerated Wed Mar 02 17:20:04 CST 2011
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.noValue = true;
}
protected Criterion(String condition, Object value) {
super();
this.condition = condition;
this.value = value;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value, Object secondValue) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.betweenValue = true;
}
}
} | unlicense |
D-Inc/EnderIO | src/main/java/crazypants/enderio/fluid/SmartTankFluidReservoirHandler.java | 685 | package crazypants.enderio.fluid;
import crazypants.enderio.machine.reservoir.TileReservoir;
import net.minecraft.util.EnumFacing;
import net.minecraftforge.fluids.capability.IFluidHandler;
public class SmartTankFluidReservoirHandler extends SmartTankFluidHandler {
private final TileReservoir te;
public SmartTankFluidReservoirHandler(TileReservoir te, IFluidHandler... tanks) {
super(tanks);
this.te = te;
}
@Override
protected boolean canFill(EnumFacing from) {
return true;
}
@Override
protected boolean canDrain(EnumFacing from) {
return te.canRefill;
}
@Override
protected boolean canAccess(EnumFacing from) {
return true;
}
}
| unlicense |
RMarinDTI/CloubityRepo | Servicio-portlet/docroot/WEB-INF/src/es/davinciti/liferay/service/base/NotaGastoLocalServiceClpInvoker.java | 33030 | /**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package es.davinciti.liferay.service.base;
import es.davinciti.liferay.service.NotaGastoLocalServiceUtil;
import java.util.Arrays;
/**
* @author Cmes
* @generated
*/
public class NotaGastoLocalServiceClpInvoker {
public NotaGastoLocalServiceClpInvoker() {
_methodName0 = "addNotaGasto";
_methodParameterTypes0 = new String[] {
"es.davinciti.liferay.model.NotaGasto"
};
_methodName1 = "createNotaGasto";
_methodParameterTypes1 = new String[] { "long" };
_methodName2 = "deleteNotaGasto";
_methodParameterTypes2 = new String[] { "long" };
_methodName3 = "deleteNotaGasto";
_methodParameterTypes3 = new String[] {
"es.davinciti.liferay.model.NotaGasto"
};
_methodName4 = "dynamicQuery";
_methodParameterTypes4 = new String[] { };
_methodName5 = "dynamicQuery";
_methodParameterTypes5 = new String[] {
"com.liferay.portal.kernel.dao.orm.DynamicQuery"
};
_methodName6 = "dynamicQuery";
_methodParameterTypes6 = new String[] {
"com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int"
};
_methodName7 = "dynamicQuery";
_methodParameterTypes7 = new String[] {
"com.liferay.portal.kernel.dao.orm.DynamicQuery", "int", "int",
"com.liferay.portal.kernel.util.OrderByComparator"
};
_methodName8 = "dynamicQueryCount";
_methodParameterTypes8 = new String[] {
"com.liferay.portal.kernel.dao.orm.DynamicQuery"
};
_methodName9 = "dynamicQueryCount";
_methodParameterTypes9 = new String[] {
"com.liferay.portal.kernel.dao.orm.DynamicQuery",
"com.liferay.portal.kernel.dao.orm.Projection"
};
_methodName10 = "fetchNotaGasto";
_methodParameterTypes10 = new String[] { "long" };
_methodName11 = "getNotaGasto";
_methodParameterTypes11 = new String[] { "long" };
_methodName12 = "getPersistedModel";
_methodParameterTypes12 = new String[] { "java.io.Serializable" };
_methodName13 = "getNotaGastos";
_methodParameterTypes13 = new String[] { "int", "int" };
_methodName14 = "getNotaGastosCount";
_methodParameterTypes14 = new String[] { };
_methodName15 = "updateNotaGasto";
_methodParameterTypes15 = new String[] {
"es.davinciti.liferay.model.NotaGasto"
};
_methodName16 = "addHistoricoNotaNotaGasto";
_methodParameterTypes16 = new String[] { "long", "long" };
_methodName17 = "addHistoricoNotaNotaGasto";
_methodParameterTypes17 = new String[] {
"long", "es.davinciti.liferay.model.NotaGasto"
};
_methodName18 = "addHistoricoNotaNotaGastos";
_methodParameterTypes18 = new String[] { "long", "long[][]" };
_methodName19 = "addHistoricoNotaNotaGastos";
_methodParameterTypes19 = new String[] { "long", "java.util.List" };
_methodName20 = "clearHistoricoNotaNotaGastos";
_methodParameterTypes20 = new String[] { "long" };
_methodName21 = "deleteHistoricoNotaNotaGasto";
_methodParameterTypes21 = new String[] { "long", "long" };
_methodName22 = "deleteHistoricoNotaNotaGasto";
_methodParameterTypes22 = new String[] {
"long", "es.davinciti.liferay.model.NotaGasto"
};
_methodName23 = "deleteHistoricoNotaNotaGastos";
_methodParameterTypes23 = new String[] { "long", "long[][]" };
_methodName24 = "deleteHistoricoNotaNotaGastos";
_methodParameterTypes24 = new String[] { "long", "java.util.List" };
_methodName25 = "getHistoricoNotaNotaGastos";
_methodParameterTypes25 = new String[] { "long" };
_methodName26 = "getHistoricoNotaNotaGastos";
_methodParameterTypes26 = new String[] { "long", "int", "int" };
_methodName27 = "getHistoricoNotaNotaGastos";
_methodParameterTypes27 = new String[] {
"long", "int", "int",
"com.liferay.portal.kernel.util.OrderByComparator"
};
_methodName28 = "getHistoricoNotaNotaGastosCount";
_methodParameterTypes28 = new String[] { "long" };
_methodName29 = "hasHistoricoNotaNotaGasto";
_methodParameterTypes29 = new String[] { "long", "long" };
_methodName30 = "hasHistoricoNotaNotaGastos";
_methodParameterTypes30 = new String[] { "long" };
_methodName31 = "setHistoricoNotaNotaGastos";
_methodParameterTypes31 = new String[] { "long", "long[][]" };
_methodName32 = "addLineaGastoNotaGasto";
_methodParameterTypes32 = new String[] { "long", "long" };
_methodName33 = "addLineaGastoNotaGasto";
_methodParameterTypes33 = new String[] {
"long", "es.davinciti.liferay.model.NotaGasto"
};
_methodName34 = "addLineaGastoNotaGastos";
_methodParameterTypes34 = new String[] { "long", "long[][]" };
_methodName35 = "addLineaGastoNotaGastos";
_methodParameterTypes35 = new String[] { "long", "java.util.List" };
_methodName36 = "clearLineaGastoNotaGastos";
_methodParameterTypes36 = new String[] { "long" };
_methodName37 = "deleteLineaGastoNotaGasto";
_methodParameterTypes37 = new String[] { "long", "long" };
_methodName38 = "deleteLineaGastoNotaGasto";
_methodParameterTypes38 = new String[] {
"long", "es.davinciti.liferay.model.NotaGasto"
};
_methodName39 = "deleteLineaGastoNotaGastos";
_methodParameterTypes39 = new String[] { "long", "long[][]" };
_methodName40 = "deleteLineaGastoNotaGastos";
_methodParameterTypes40 = new String[] { "long", "java.util.List" };
_methodName41 = "getLineaGastoNotaGastos";
_methodParameterTypes41 = new String[] { "long" };
_methodName42 = "getLineaGastoNotaGastos";
_methodParameterTypes42 = new String[] { "long", "int", "int" };
_methodName43 = "getLineaGastoNotaGastos";
_methodParameterTypes43 = new String[] {
"long", "int", "int",
"com.liferay.portal.kernel.util.OrderByComparator"
};
_methodName44 = "getLineaGastoNotaGastosCount";
_methodParameterTypes44 = new String[] { "long" };
_methodName45 = "hasLineaGastoNotaGasto";
_methodParameterTypes45 = new String[] { "long", "long" };
_methodName46 = "hasLineaGastoNotaGastos";
_methodParameterTypes46 = new String[] { "long" };
_methodName47 = "setLineaGastoNotaGastos";
_methodParameterTypes47 = new String[] { "long", "long[][]" };
_methodName48 = "addOrganizationSageCompanyNotaGasto";
_methodParameterTypes48 = new String[] { "long", "long" };
_methodName49 = "addOrganizationSageCompanyNotaGasto";
_methodParameterTypes49 = new String[] {
"long", "es.davinciti.liferay.model.NotaGasto"
};
_methodName50 = "addOrganizationSageCompanyNotaGastos";
_methodParameterTypes50 = new String[] { "long", "long[][]" };
_methodName51 = "addOrganizationSageCompanyNotaGastos";
_methodParameterTypes51 = new String[] { "long", "java.util.List" };
_methodName52 = "clearOrganizationSageCompanyNotaGastos";
_methodParameterTypes52 = new String[] { "long" };
_methodName53 = "deleteOrganizationSageCompanyNotaGasto";
_methodParameterTypes53 = new String[] { "long", "long" };
_methodName54 = "deleteOrganizationSageCompanyNotaGasto";
_methodParameterTypes54 = new String[] {
"long", "es.davinciti.liferay.model.NotaGasto"
};
_methodName55 = "deleteOrganizationSageCompanyNotaGastos";
_methodParameterTypes55 = new String[] { "long", "long[][]" };
_methodName56 = "deleteOrganizationSageCompanyNotaGastos";
_methodParameterTypes56 = new String[] { "long", "java.util.List" };
_methodName57 = "getOrganizationSageCompanyNotaGastos";
_methodParameterTypes57 = new String[] { "long" };
_methodName58 = "getOrganizationSageCompanyNotaGastos";
_methodParameterTypes58 = new String[] { "long", "int", "int" };
_methodName59 = "getOrganizationSageCompanyNotaGastos";
_methodParameterTypes59 = new String[] {
"long", "int", "int",
"com.liferay.portal.kernel.util.OrderByComparator"
};
_methodName60 = "getOrganizationSageCompanyNotaGastosCount";
_methodParameterTypes60 = new String[] { "long" };
_methodName61 = "hasOrganizationSageCompanyNotaGasto";
_methodParameterTypes61 = new String[] { "long", "long" };
_methodName62 = "hasOrganizationSageCompanyNotaGastos";
_methodParameterTypes62 = new String[] { "long" };
_methodName63 = "setOrganizationSageCompanyNotaGastos";
_methodParameterTypes63 = new String[] { "long", "long[][]" };
_methodName202 = "getBeanIdentifier";
_methodParameterTypes202 = new String[] { };
_methodName203 = "setBeanIdentifier";
_methodParameterTypes203 = new String[] { "java.lang.String" };
_methodName208 = "getOrganizationsSageCompanies";
_methodParameterTypes208 = new String[] { "long" };
_methodName209 = "getSageCompany";
_methodParameterTypes209 = new String[] { "long" };
_methodName210 = "findByCompanyIdUserId";
_methodParameterTypes210 = new String[] { "long", "long" };
_methodName211 = "findByCompanyId";
_methodParameterTypes211 = new String[] { "long" };
_methodName212 = "deleteNotaGastoLineas";
_methodParameterTypes212 = new String[] { "long" };
_methodName213 = "validateNotaGasto";
_methodParameterTypes213 = new String[] {
"long", "long", "long", "java.util.Locale"
};
_methodName214 = "getSageEmployeeId";
_methodParameterTypes214 = new String[] { "long" };
}
public Object invokeMethod(String name, String[] parameterTypes,
Object[] arguments) throws Throwable {
if (_methodName0.equals(name) &&
Arrays.deepEquals(_methodParameterTypes0, parameterTypes)) {
return NotaGastoLocalServiceUtil.addNotaGasto((es.davinciti.liferay.model.NotaGasto)arguments[0]);
}
if (_methodName1.equals(name) &&
Arrays.deepEquals(_methodParameterTypes1, parameterTypes)) {
return NotaGastoLocalServiceUtil.createNotaGasto(((Long)arguments[0]).longValue());
}
if (_methodName2.equals(name) &&
Arrays.deepEquals(_methodParameterTypes2, parameterTypes)) {
return NotaGastoLocalServiceUtil.deleteNotaGasto(((Long)arguments[0]).longValue());
}
if (_methodName3.equals(name) &&
Arrays.deepEquals(_methodParameterTypes3, parameterTypes)) {
return NotaGastoLocalServiceUtil.deleteNotaGasto((es.davinciti.liferay.model.NotaGasto)arguments[0]);
}
if (_methodName4.equals(name) &&
Arrays.deepEquals(_methodParameterTypes4, parameterTypes)) {
return NotaGastoLocalServiceUtil.dynamicQuery();
}
if (_methodName5.equals(name) &&
Arrays.deepEquals(_methodParameterTypes5, parameterTypes)) {
return NotaGastoLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]);
}
if (_methodName6.equals(name) &&
Arrays.deepEquals(_methodParameterTypes6, parameterTypes)) {
return NotaGastoLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue());
}
if (_methodName7.equals(name) &&
Arrays.deepEquals(_methodParameterTypes7, parameterTypes)) {
return NotaGastoLocalServiceUtil.dynamicQuery((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue(),
(com.liferay.portal.kernel.util.OrderByComparator)arguments[3]);
}
if (_methodName8.equals(name) &&
Arrays.deepEquals(_methodParameterTypes8, parameterTypes)) {
return NotaGastoLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0]);
}
if (_methodName9.equals(name) &&
Arrays.deepEquals(_methodParameterTypes9, parameterTypes)) {
return NotaGastoLocalServiceUtil.dynamicQueryCount((com.liferay.portal.kernel.dao.orm.DynamicQuery)arguments[0],
(com.liferay.portal.kernel.dao.orm.Projection)arguments[1]);
}
if (_methodName10.equals(name) &&
Arrays.deepEquals(_methodParameterTypes10, parameterTypes)) {
return NotaGastoLocalServiceUtil.fetchNotaGasto(((Long)arguments[0]).longValue());
}
if (_methodName11.equals(name) &&
Arrays.deepEquals(_methodParameterTypes11, parameterTypes)) {
return NotaGastoLocalServiceUtil.getNotaGasto(((Long)arguments[0]).longValue());
}
if (_methodName12.equals(name) &&
Arrays.deepEquals(_methodParameterTypes12, parameterTypes)) {
return NotaGastoLocalServiceUtil.getPersistedModel((java.io.Serializable)arguments[0]);
}
if (_methodName13.equals(name) &&
Arrays.deepEquals(_methodParameterTypes13, parameterTypes)) {
return NotaGastoLocalServiceUtil.getNotaGastos(((Integer)arguments[0]).intValue(),
((Integer)arguments[1]).intValue());
}
if (_methodName14.equals(name) &&
Arrays.deepEquals(_methodParameterTypes14, parameterTypes)) {
return NotaGastoLocalServiceUtil.getNotaGastosCount();
}
if (_methodName15.equals(name) &&
Arrays.deepEquals(_methodParameterTypes15, parameterTypes)) {
return NotaGastoLocalServiceUtil.updateNotaGasto((es.davinciti.liferay.model.NotaGasto)arguments[0]);
}
if (_methodName16.equals(name) &&
Arrays.deepEquals(_methodParameterTypes16, parameterTypes)) {
NotaGastoLocalServiceUtil.addHistoricoNotaNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
}
if (_methodName17.equals(name) &&
Arrays.deepEquals(_methodParameterTypes17, parameterTypes)) {
NotaGastoLocalServiceUtil.addHistoricoNotaNotaGasto(((Long)arguments[0]).longValue(),
(es.davinciti.liferay.model.NotaGasto)arguments[1]);
return null;
}
if (_methodName18.equals(name) &&
Arrays.deepEquals(_methodParameterTypes18, parameterTypes)) {
NotaGastoLocalServiceUtil.addHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName19.equals(name) &&
Arrays.deepEquals(_methodParameterTypes19, parameterTypes)) {
NotaGastoLocalServiceUtil.addHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
(java.util.List<es.davinciti.liferay.model.NotaGasto>)arguments[1]);
return null;
}
if (_methodName20.equals(name) &&
Arrays.deepEquals(_methodParameterTypes20, parameterTypes)) {
NotaGastoLocalServiceUtil.clearHistoricoNotaNotaGastos(((Long)arguments[0]).longValue());
return null;
}
if (_methodName21.equals(name) &&
Arrays.deepEquals(_methodParameterTypes21, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteHistoricoNotaNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
}
if (_methodName22.equals(name) &&
Arrays.deepEquals(_methodParameterTypes22, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteHistoricoNotaNotaGasto(((Long)arguments[0]).longValue(),
(es.davinciti.liferay.model.NotaGasto)arguments[1]);
return null;
}
if (_methodName23.equals(name) &&
Arrays.deepEquals(_methodParameterTypes23, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName24.equals(name) &&
Arrays.deepEquals(_methodParameterTypes24, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
(java.util.List<es.davinciti.liferay.model.NotaGasto>)arguments[1]);
return null;
}
if (_methodName25.equals(name) &&
Arrays.deepEquals(_methodParameterTypes25, parameterTypes)) {
return NotaGastoLocalServiceUtil.getHistoricoNotaNotaGastos(((Long)arguments[0]).longValue());
}
if (_methodName26.equals(name) &&
Arrays.deepEquals(_methodParameterTypes26, parameterTypes)) {
return NotaGastoLocalServiceUtil.getHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue());
}
if (_methodName27.equals(name) &&
Arrays.deepEquals(_methodParameterTypes27, parameterTypes)) {
return NotaGastoLocalServiceUtil.getHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue(),
(com.liferay.portal.kernel.util.OrderByComparator)arguments[3]);
}
if (_methodName28.equals(name) &&
Arrays.deepEquals(_methodParameterTypes28, parameterTypes)) {
return NotaGastoLocalServiceUtil.getHistoricoNotaNotaGastosCount(((Long)arguments[0]).longValue());
}
if (_methodName29.equals(name) &&
Arrays.deepEquals(_methodParameterTypes29, parameterTypes)) {
return NotaGastoLocalServiceUtil.hasHistoricoNotaNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
}
if (_methodName30.equals(name) &&
Arrays.deepEquals(_methodParameterTypes30, parameterTypes)) {
return NotaGastoLocalServiceUtil.hasHistoricoNotaNotaGastos(((Long)arguments[0]).longValue());
}
if (_methodName31.equals(name) &&
Arrays.deepEquals(_methodParameterTypes31, parameterTypes)) {
NotaGastoLocalServiceUtil.setHistoricoNotaNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName32.equals(name) &&
Arrays.deepEquals(_methodParameterTypes32, parameterTypes)) {
NotaGastoLocalServiceUtil.addLineaGastoNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
}
if (_methodName33.equals(name) &&
Arrays.deepEquals(_methodParameterTypes33, parameterTypes)) {
NotaGastoLocalServiceUtil.addLineaGastoNotaGasto(((Long)arguments[0]).longValue(),
(es.davinciti.liferay.model.NotaGasto)arguments[1]);
return null;
}
if (_methodName34.equals(name) &&
Arrays.deepEquals(_methodParameterTypes34, parameterTypes)) {
NotaGastoLocalServiceUtil.addLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName35.equals(name) &&
Arrays.deepEquals(_methodParameterTypes35, parameterTypes)) {
NotaGastoLocalServiceUtil.addLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
(java.util.List<es.davinciti.liferay.model.NotaGasto>)arguments[1]);
return null;
}
if (_methodName36.equals(name) &&
Arrays.deepEquals(_methodParameterTypes36, parameterTypes)) {
NotaGastoLocalServiceUtil.clearLineaGastoNotaGastos(((Long)arguments[0]).longValue());
return null;
}
if (_methodName37.equals(name) &&
Arrays.deepEquals(_methodParameterTypes37, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteLineaGastoNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
}
if (_methodName38.equals(name) &&
Arrays.deepEquals(_methodParameterTypes38, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteLineaGastoNotaGasto(((Long)arguments[0]).longValue(),
(es.davinciti.liferay.model.NotaGasto)arguments[1]);
return null;
}
if (_methodName39.equals(name) &&
Arrays.deepEquals(_methodParameterTypes39, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName40.equals(name) &&
Arrays.deepEquals(_methodParameterTypes40, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
(java.util.List<es.davinciti.liferay.model.NotaGasto>)arguments[1]);
return null;
}
if (_methodName41.equals(name) &&
Arrays.deepEquals(_methodParameterTypes41, parameterTypes)) {
return NotaGastoLocalServiceUtil.getLineaGastoNotaGastos(((Long)arguments[0]).longValue());
}
if (_methodName42.equals(name) &&
Arrays.deepEquals(_methodParameterTypes42, parameterTypes)) {
return NotaGastoLocalServiceUtil.getLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue());
}
if (_methodName43.equals(name) &&
Arrays.deepEquals(_methodParameterTypes43, parameterTypes)) {
return NotaGastoLocalServiceUtil.getLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue(),
(com.liferay.portal.kernel.util.OrderByComparator)arguments[3]);
}
if (_methodName44.equals(name) &&
Arrays.deepEquals(_methodParameterTypes44, parameterTypes)) {
return NotaGastoLocalServiceUtil.getLineaGastoNotaGastosCount(((Long)arguments[0]).longValue());
}
if (_methodName45.equals(name) &&
Arrays.deepEquals(_methodParameterTypes45, parameterTypes)) {
return NotaGastoLocalServiceUtil.hasLineaGastoNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
}
if (_methodName46.equals(name) &&
Arrays.deepEquals(_methodParameterTypes46, parameterTypes)) {
return NotaGastoLocalServiceUtil.hasLineaGastoNotaGastos(((Long)arguments[0]).longValue());
}
if (_methodName47.equals(name) &&
Arrays.deepEquals(_methodParameterTypes47, parameterTypes)) {
NotaGastoLocalServiceUtil.setLineaGastoNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName48.equals(name) &&
Arrays.deepEquals(_methodParameterTypes48, parameterTypes)) {
NotaGastoLocalServiceUtil.addOrganizationSageCompanyNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
}
if (_methodName49.equals(name) &&
Arrays.deepEquals(_methodParameterTypes49, parameterTypes)) {
NotaGastoLocalServiceUtil.addOrganizationSageCompanyNotaGasto(((Long)arguments[0]).longValue(),
(es.davinciti.liferay.model.NotaGasto)arguments[1]);
return null;
}
if (_methodName50.equals(name) &&
Arrays.deepEquals(_methodParameterTypes50, parameterTypes)) {
NotaGastoLocalServiceUtil.addOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName51.equals(name) &&
Arrays.deepEquals(_methodParameterTypes51, parameterTypes)) {
NotaGastoLocalServiceUtil.addOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
(java.util.List<es.davinciti.liferay.model.NotaGasto>)arguments[1]);
return null;
}
if (_methodName52.equals(name) &&
Arrays.deepEquals(_methodParameterTypes52, parameterTypes)) {
NotaGastoLocalServiceUtil.clearOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue());
return null;
}
if (_methodName53.equals(name) &&
Arrays.deepEquals(_methodParameterTypes53, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteOrganizationSageCompanyNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
return null;
}
if (_methodName54.equals(name) &&
Arrays.deepEquals(_methodParameterTypes54, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteOrganizationSageCompanyNotaGasto(((Long)arguments[0]).longValue(),
(es.davinciti.liferay.model.NotaGasto)arguments[1]);
return null;
}
if (_methodName55.equals(name) &&
Arrays.deepEquals(_methodParameterTypes55, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName56.equals(name) &&
Arrays.deepEquals(_methodParameterTypes56, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
(java.util.List<es.davinciti.liferay.model.NotaGasto>)arguments[1]);
return null;
}
if (_methodName57.equals(name) &&
Arrays.deepEquals(_methodParameterTypes57, parameterTypes)) {
return NotaGastoLocalServiceUtil.getOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue());
}
if (_methodName58.equals(name) &&
Arrays.deepEquals(_methodParameterTypes58, parameterTypes)) {
return NotaGastoLocalServiceUtil.getOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue());
}
if (_methodName59.equals(name) &&
Arrays.deepEquals(_methodParameterTypes59, parameterTypes)) {
return NotaGastoLocalServiceUtil.getOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
((Integer)arguments[1]).intValue(),
((Integer)arguments[2]).intValue(),
(com.liferay.portal.kernel.util.OrderByComparator)arguments[3]);
}
if (_methodName60.equals(name) &&
Arrays.deepEquals(_methodParameterTypes60, parameterTypes)) {
return NotaGastoLocalServiceUtil.getOrganizationSageCompanyNotaGastosCount(((Long)arguments[0]).longValue());
}
if (_methodName61.equals(name) &&
Arrays.deepEquals(_methodParameterTypes61, parameterTypes)) {
return NotaGastoLocalServiceUtil.hasOrganizationSageCompanyNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
}
if (_methodName62.equals(name) &&
Arrays.deepEquals(_methodParameterTypes62, parameterTypes)) {
return NotaGastoLocalServiceUtil.hasOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue());
}
if (_methodName63.equals(name) &&
Arrays.deepEquals(_methodParameterTypes63, parameterTypes)) {
NotaGastoLocalServiceUtil.setOrganizationSageCompanyNotaGastos(((Long)arguments[0]).longValue(),
(long[])arguments[1]);
return null;
}
if (_methodName202.equals(name) &&
Arrays.deepEquals(_methodParameterTypes202, parameterTypes)) {
return NotaGastoLocalServiceUtil.getBeanIdentifier();
}
if (_methodName203.equals(name) &&
Arrays.deepEquals(_methodParameterTypes203, parameterTypes)) {
NotaGastoLocalServiceUtil.setBeanIdentifier((java.lang.String)arguments[0]);
return null;
}
if (_methodName208.equals(name) &&
Arrays.deepEquals(_methodParameterTypes208, parameterTypes)) {
return NotaGastoLocalServiceUtil.getOrganizationsSageCompanies(((Long)arguments[0]).longValue());
}
if (_methodName209.equals(name) &&
Arrays.deepEquals(_methodParameterTypes209, parameterTypes)) {
return NotaGastoLocalServiceUtil.getSageCompany(((Long)arguments[0]).longValue());
}
if (_methodName210.equals(name) &&
Arrays.deepEquals(_methodParameterTypes210, parameterTypes)) {
return NotaGastoLocalServiceUtil.findByCompanyIdUserId(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue());
}
if (_methodName211.equals(name) &&
Arrays.deepEquals(_methodParameterTypes211, parameterTypes)) {
return NotaGastoLocalServiceUtil.findByCompanyId(((Long)arguments[0]).longValue());
}
if (_methodName212.equals(name) &&
Arrays.deepEquals(_methodParameterTypes212, parameterTypes)) {
NotaGastoLocalServiceUtil.deleteNotaGastoLineas(((Long)arguments[0]).longValue());
return null;
}
if (_methodName213.equals(name) &&
Arrays.deepEquals(_methodParameterTypes213, parameterTypes)) {
return NotaGastoLocalServiceUtil.validateNotaGasto(((Long)arguments[0]).longValue(),
((Long)arguments[1]).longValue(),
((Long)arguments[2]).longValue(), (java.util.Locale)arguments[3]);
}
if (_methodName214.equals(name) &&
Arrays.deepEquals(_methodParameterTypes214, parameterTypes)) {
return NotaGastoLocalServiceUtil.getSageEmployeeId(((Long)arguments[0]).longValue());
}
throw new UnsupportedOperationException();
}
private String _methodName0;
private String[] _methodParameterTypes0;
private String _methodName1;
private String[] _methodParameterTypes1;
private String _methodName2;
private String[] _methodParameterTypes2;
private String _methodName3;
private String[] _methodParameterTypes3;
private String _methodName4;
private String[] _methodParameterTypes4;
private String _methodName5;
private String[] _methodParameterTypes5;
private String _methodName6;
private String[] _methodParameterTypes6;
private String _methodName7;
private String[] _methodParameterTypes7;
private String _methodName8;
private String[] _methodParameterTypes8;
private String _methodName9;
private String[] _methodParameterTypes9;
private String _methodName10;
private String[] _methodParameterTypes10;
private String _methodName11;
private String[] _methodParameterTypes11;
private String _methodName12;
private String[] _methodParameterTypes12;
private String _methodName13;
private String[] _methodParameterTypes13;
private String _methodName14;
private String[] _methodParameterTypes14;
private String _methodName15;
private String[] _methodParameterTypes15;
private String _methodName16;
private String[] _methodParameterTypes16;
private String _methodName17;
private String[] _methodParameterTypes17;
private String _methodName18;
private String[] _methodParameterTypes18;
private String _methodName19;
private String[] _methodParameterTypes19;
private String _methodName20;
private String[] _methodParameterTypes20;
private String _methodName21;
private String[] _methodParameterTypes21;
private String _methodName22;
private String[] _methodParameterTypes22;
private String _methodName23;
private String[] _methodParameterTypes23;
private String _methodName24;
private String[] _methodParameterTypes24;
private String _methodName25;
private String[] _methodParameterTypes25;
private String _methodName26;
private String[] _methodParameterTypes26;
private String _methodName27;
private String[] _methodParameterTypes27;
private String _methodName28;
private String[] _methodParameterTypes28;
private String _methodName29;
private String[] _methodParameterTypes29;
private String _methodName30;
private String[] _methodParameterTypes30;
private String _methodName31;
private String[] _methodParameterTypes31;
private String _methodName32;
private String[] _methodParameterTypes32;
private String _methodName33;
private String[] _methodParameterTypes33;
private String _methodName34;
private String[] _methodParameterTypes34;
private String _methodName35;
private String[] _methodParameterTypes35;
private String _methodName36;
private String[] _methodParameterTypes36;
private String _methodName37;
private String[] _methodParameterTypes37;
private String _methodName38;
private String[] _methodParameterTypes38;
private String _methodName39;
private String[] _methodParameterTypes39;
private String _methodName40;
private String[] _methodParameterTypes40;
private String _methodName41;
private String[] _methodParameterTypes41;
private String _methodName42;
private String[] _methodParameterTypes42;
private String _methodName43;
private String[] _methodParameterTypes43;
private String _methodName44;
private String[] _methodParameterTypes44;
private String _methodName45;
private String[] _methodParameterTypes45;
private String _methodName46;
private String[] _methodParameterTypes46;
private String _methodName47;
private String[] _methodParameterTypes47;
private String _methodName48;
private String[] _methodParameterTypes48;
private String _methodName49;
private String[] _methodParameterTypes49;
private String _methodName50;
private String[] _methodParameterTypes50;
private String _methodName51;
private String[] _methodParameterTypes51;
private String _methodName52;
private String[] _methodParameterTypes52;
private String _methodName53;
private String[] _methodParameterTypes53;
private String _methodName54;
private String[] _methodParameterTypes54;
private String _methodName55;
private String[] _methodParameterTypes55;
private String _methodName56;
private String[] _methodParameterTypes56;
private String _methodName57;
private String[] _methodParameterTypes57;
private String _methodName58;
private String[] _methodParameterTypes58;
private String _methodName59;
private String[] _methodParameterTypes59;
private String _methodName60;
private String[] _methodParameterTypes60;
private String _methodName61;
private String[] _methodParameterTypes61;
private String _methodName62;
private String[] _methodParameterTypes62;
private String _methodName63;
private String[] _methodParameterTypes63;
private String _methodName202;
private String[] _methodParameterTypes202;
private String _methodName203;
private String[] _methodParameterTypes203;
private String _methodName208;
private String[] _methodParameterTypes208;
private String _methodName209;
private String[] _methodParameterTypes209;
private String _methodName210;
private String[] _methodParameterTypes210;
private String _methodName211;
private String[] _methodParameterTypes211;
private String _methodName212;
private String[] _methodParameterTypes212;
private String _methodName213;
private String[] _methodParameterTypes213;
private String _methodName214;
private String[] _methodParameterTypes214;
} | unlicense |
CodeBeings/GeoWod | Mobile/Android/Code/GeoWod/Urocks/app/src/main/java/com/urocks/activity/DrawerActivity.java | 4919 | package com.urocks.activity;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.widget.DrawerLayout;
import android.support.v7.app.ActionBarDrawerToggle;
import android.support.v7.app.AppCompatActivity;
import android.view.Gravity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
/**
* Created by sony on 17-10-2015.
*/
public class DrawerActivity extends AppCompatActivity implements AdapterView.OnItemClickListener,View.OnClickListener{
private DrawerLayout mDrawerLayout;
private ActionBarDrawerToggle mDrawerToggle;
private ListView listView;
private ImageView mToolbar;
private TextView mTile;
Fragment fragment;
android.support.v4.app.FragmentTransaction fragmentTransaction;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main_acitvity);
String [] values = new String[]{"Home","Challenges","LeaderBoard","EarnPoints","Profile","Logout"};
ListViewAdapter adapter = new ListViewAdapter(this,R.layout.home_drawer,values);
mDrawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout);
mToolbar = (ImageView) findViewById(R.id.toolbar_top_left_image);
listView = (ListView) findViewById(R.id.listview);
mTile = (TextView) findViewById(R.id.textview_title);
listView.setAdapter(adapter);
mDrawerToggle = new ActionBarDrawerToggle(this,mDrawerLayout,null, R.string.openDrawer,R.string.closeDrawer){
@Override
public void onDrawerClosed(View drawerView) {
super.onDrawerClosed(drawerView);
}
@Override
public void onDrawerOpened(View drawerView) {
super.onDrawerOpened(drawerView);
}
};
mDrawerLayout.setDrawerListener(mDrawerToggle);
mDrawerToggle.syncState();
listView.setOnItemClickListener(this);
mToolbar.setOnClickListener(this);
}
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
closeDrawers();
switch (position){
case 0:
Toast.makeText(getApplicationContext(), "home Selected", Toast.LENGTH_SHORT).show();
setTitle("Home");
fragment = new FragmentLocation();
fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.frame, fragment);
fragmentTransaction.commit();
break;
case 1:
Toast.makeText(getApplicationContext(), "challenges Selected", Toast.LENGTH_SHORT).show();
setTitle("Challenges");
fragment = new Challenges_fragment();
fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.frame, fragment);
fragmentTransaction.commit();
break;
case 2:
Toast.makeText(getApplicationContext(), "leaderboard Selected", Toast.LENGTH_SHORT).show();
setTitle("LeaderBoard");
break;
case 3:
setTitle("EarnPoints");
Toast.makeText(getApplicationContext(), "earnpoints Selected", Toast.LENGTH_SHORT).show();
break;
case 4:
setTitle("Profile");
fragment = new ContentFragment();
fragmentTransaction = getSupportFragmentManager().beginTransaction();
fragmentTransaction.replace(R.id.frame, fragment);
fragmentTransaction.commit();
break;
case 5:
setTitle("Logout");
Toast.makeText(getApplicationContext(), "APP Close", Toast.LENGTH_SHORT).show();
break;
default:
Toast.makeText(getApplicationContext(), "Somethings Wrong", Toast.LENGTH_SHORT).show();
break;
}
}
private void closeDrawers()
{
if ( mDrawerLayout.isDrawerOpen(Gravity.LEFT)){
mDrawerLayout.closeDrawers();
}
}
@Override
public void onClick(View v) {
switch (v.getId()){
case R.id.toolbar_top_left_image:
mDrawerLayout.openDrawer(Gravity.LEFT);
break;
}
}
@Override
public void onBackPressed() {
if ( mDrawerLayout.isDrawerOpen(Gravity.LEFT)){
mDrawerLayout.closeDrawers();
}else {
super.onBackPressed();
}
}
private void setTitle(String title)
{
mTile.setText(title);
}
}
| unlicense |
zhaoccx/COM | JavaServletLifeCycle/src/servlet/TestServlet1.java | 2747 | package servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class TestServlet1 extends HttpServlet {
/**
*
*/
private static final long serialVersionUID = -245608836448364517L;
/**
* Constructor of the object.
*/
public TestServlet1() {
System.out.println("TestServlet1¹¹Ôì·½·¨±»Ö´ÐÐ....");
}
/**
* Destruction of the servlet. <br>
*/
@Override
public void destroy() {
System.out.println("TestServlet1Ïú»Ù·½·¨±»Ö´ÐÐ....");
}
/**
* The doGet method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to get.
*
* @param request
* the request send by the client to the server
* @param response
* the response send by the server to the client
* @throws ServletException
* if an error occurred
* @throws IOException
* if an error occurred
*/
@Override
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("TestServlet1µÄdoGet()·½·¨±»Ö´ÐÐ...");
response.setContentType("text/html;charset=utf-8");
PrintWriter out = response.getWriter();
out.println("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">");
out.println("<HTML>");
out.println(" <HEAD><TITLE>A Servlet</TITLE></HEAD>");
out.println(" <BODY>");
out.println("<h1>´ó¼ÒºÃ£¬ÎÒÊÇTestServlet1£¡</h1>");
out.println(" </BODY>");
out.println("</HTML>");
out.flush();
out.close();
}
/**
* The doPost method of the servlet. <br>
*
* This method is called when a form has its tag value method equals to
* post.
*
* @param request
* the request send by the client to the server
* @param response
* the response send by the server to the client
* @throws ServletException
* if an error occurred
* @throws IOException
* if an error occurred
*/
@Override
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println("TestServlet1µÄdoPost()·½·¨±»Ö´ÐÐ...");
doGet(request, response); // ÈÃdoPost()Ö´ÐÐÓëdoGet()ÏàͬµÄ²Ù×÷¡£
}
/**
* Initialization of the servlet. <br>
*
* @throws ServletException
* if an error occurs
*/
@Override
public void init() throws ServletException {
// Put your code here
System.out.println("TestServlet1µÄ³õʼ»¯·½·¨±»Ö´ÐÐ....");
}
}
| unlicense |
W0mpRat/IntroToProgramming | Code/FinalExam/ArrayRows/MatrixRowTester.java | 537 | public class MatrixRowTester
{
public static void main(String[] args)
{
int[][] array = { {1, 2, 3, 4},
{7, 8, 9, 10},
{2, 4, 6, 8}
};
Matrix matrix = new Matrix(array);
System.out.println(matrix.numberOfRows());
System.out.println("Expected: 3");
array = new int[10][5];
matrix = new Matrix(array);
System.out.println(matrix.numberOfRows());
System.out.println("Expected: 10");
}
} | unlicense |
binkley/binkley | annotation/src/main/java/hm/binkley/annotation/processing/SingleAnnotationProcessor.java | 5883 | /*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
* In jurisdictions that recognize copyright laws, the author or authors
* of this software dedicate any and all copyright interest in the
* software to the public domain. We make this dedication for the benefit
* of the public at large and to the detriment of our heirs and
* successors. We intend this dedication to be an overt act of
* relinquishment in perpetuity of all present and future rights to this
* software under copyright law.
*
* 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 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.
*
* For more information, please refer to <http://unlicense.org/>.
*/
package hm.binkley.annotation.processing;
import javax.annotation.processing.AbstractProcessor;
import javax.annotation.processing.Messager;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.AnnotationMirror;
import javax.lang.model.element.AnnotationValue;
import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement;
import java.lang.annotation.Annotation;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import static java.lang.String.format;
import static javax.tools.Diagnostic.Kind.ERROR;
/**
* {@code SingleAnnotationProcessor} <b>needs documentation</b>.
*
* @author <a href="mailto:binkley@alumni.rice.edu">B. K. Oxley (binkley)</a>
* @todo Needs documentation.
*/
public abstract class SingleAnnotationProcessor<A extends Annotation, M extends SingleAnnotationMessager<A, M>>
extends AbstractProcessor {
private final Class<A> annoType;
// TODO: Rework to avoid writeable state
protected M out;
protected SingleAnnotationProcessor(final Class<A> annoType) {
this.annoType = annoType;
}
protected abstract M newMesseger(final Class<A> annoType,
final Messager messager, final Element element);
protected boolean preValidate(final Element element, final A anno) {
return true;
}
protected abstract void process(final Element element, final A anno);
protected String withAnnotationValue() {
return null;
}
protected boolean postValidate(final Element element, final A anno) {
return true;
}
protected boolean postValidate() {
return true;
}
@Override
public final boolean process(final Set<? extends TypeElement> annotations,
final RoundEnvironment roundEnv) {
final Set<? extends Element> elements = roundEnv
.getElementsAnnotatedWith(annoType);
for (final Element element : elements)
try {
out = newMesseger(annoType, processingEnv.getMessager(),
element);
// Use both annotation and mirror:
// - Annotation is easier for accessing members
// - Mirror is needed for messenger
final AnnotationMirror aMirror = annotationMirror(element);
if (null == aMirror)
continue;
// Optionally narrow down logging to specific anno value
final String annotationValue = withAnnotationValue();
if (null != annotationValue)
out = out.withAnnotation(aMirror,
annotationValue(aMirror, annotationValue));
final A anno = element.getAnnotation(annoType);
if (!preValidate(element, anno))
continue;
process(element, anno);
if (postValidate(element, anno))
return false;
} catch (final Exception e) {
out.error(e, "Cannot process %@ on '%s'", element);
return false;
}
try {
return postValidate();
} catch (final Exception e) {
processingEnv.getMessager().printMessage(ERROR,
format("Cannot process @%s on one of '%s'",
annoType.getName(), elements));
return false;
}
}
private AnnotationMirror annotationMirror(final Element element) {
// TODO: How to do this without resorting to toString()?
final List<AnnotationMirror> found = element.
getAnnotationMirrors().stream().
filter(m -> m.getAnnotationType().
toString().
equals(annoType.getCanonicalName())).
collect(Collectors.<AnnotationMirror>toList());
switch (found.size()) {
case 1:
return found.get(0);
case 0:
out.error("%@ missing from element");
return null;
default:
out.error("%@ only supports 1 occurrence");
return null;
}
}
protected static AnnotationValue annotationValue(
final AnnotationMirror aMirror, final String param) {
return aMirror.getElementValues().entrySet().stream().
filter(e -> e.getKey().getSimpleName().contentEquals(param)).
map(Map.Entry::getValue).
findAny().
orElse(null);
}
}
| unlicense |
dbarlavento/ifpe_pdm | FrutaGratis/app/src/main/java/barlapcb/frutagratis/InitActivity.java | 3805 | package barlapcb.frutagratis;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.google.android.gms.tasks.OnCompleteListener;
import com.google.android.gms.tasks.Task;
import com.google.firebase.auth.AuthResult;
import com.google.firebase.auth.FirebaseAuth;
import com.google.firebase.auth.FirebaseUser;
/* Esta classe possui diversas gambiarras que devem ser corrigidas */
public class InitActivity extends AppCompatActivity {
private FirebaseAuth authUsuario;
private FirebaseAuth.AuthStateListener mAuthListener;
private String email;
private String senha;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_init);
authUsuario = FirebaseAuth.getInstance();
mAuthListener = getmAuthListener();
}
@Override
public void onStart() {
super.onStart();
authUsuario.addAuthStateListener(mAuthListener);
}
@Override
public void onStop() {
super.onStop();
if (mAuthListener != null) {
authUsuario.removeAuthStateListener(mAuthListener);
}
}
private FirebaseAuth.AuthStateListener getmAuthListener() {
return new FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull FirebaseAuth firebaseAuth) {
FirebaseUser user = firebaseAuth.getCurrentUser();
if (user != null) {
Intent intent = new Intent( InitActivity.this, MapActivity.class );
startActivity( intent );
} else {
Toast.makeText(InitActivity.this, "Você está desconectado",
Toast.LENGTH_SHORT).show();
}
}
};
}
private boolean validarLogin(String e, String s) {
return true;
}
/* Realiza login no sistema */
public void entrar( View view ) {
EditText in_email = (EditText) findViewById(R.id.login_in_email);
EditText in_senha = (EditText) findViewById(R.id.login_in_senha);
email = in_email.getText().toString();
senha = in_senha.getText().toString();
if( validarEmail(email) && validarSenha(senha)) {
authUsuario.signInWithEmailAndPassword(email, senha)
.addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {
@Override
public void onComplete(@NonNull Task<AuthResult> task) {
if (!task.isSuccessful()) {
Toast.makeText(InitActivity.this, "E-mail ou senha incorretos",
Toast.LENGTH_SHORT).show();
}
}
});
} else {
Toast.makeText(InitActivity.this, "E-mail ou senha incorretos",
Toast.LENGTH_SHORT).show();
}
}
/* Registra um novo usuário */
public void registrarNovoUsuario(View view) {
Intent intent = new Intent( this, RegistrarActivity.class );
startActivity( intent );
}
public void recuperarSenha(View view) {
Intent intent = new Intent( this, RecupSenhaActivity.class );
startActivity( intent );
}
private boolean validarSenha(String senha) {
return senha.length() >= 6;
}
private boolean validarEmail(String email) {
return email.contains(".com") && email.contains("@");
}
}
| unlicense |
InContextSolutions/disunity | src/info/ata4/unity/cli/extract/AssetExtractor.java | 8491 | /*
** 2013 June 16
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
*/
package info.ata4.unity.cli.extract;
import info.ata4.io.buffer.ByteBufferUtils;
import info.ata4.io.file.FilenameSanitizer;
import info.ata4.log.LogUtils;
import info.ata4.unity.asset.AssetFile;
import info.ata4.unity.asset.struct.ObjectPath;
import info.ata4.unity.asset.struct.TypeTree;
import info.ata4.unity.cli.classfilter.ClassFilter;
import info.ata4.unity.cli.extract.mesh.MeshHandler;
import info.ata4.unity.serdes.Deserializer;
import info.ata4.unity.serdes.UnityObject;
import info.ata4.unity.util.ClassID;
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Extractor for asset files.
*
* @author Nico Bergemann <barracuda415 at yahoo.de>
*/
public class AssetExtractor {
private static final Logger L = LogUtils.getLogger();
/**
* Tries to get the name of an object by deserializing it and looking for
* the field "m_Name". If it exists, return its value.
*
* @param asset asset file
* @param path object path
* @return Name string of the object or null if it doesn't have a name or if
* the deserialization failed.
*/
public static String getObjectName(AssetFile asset, ObjectPath path) {
Deserializer deser = new Deserializer(asset);
String name = null;
try {
UnityObject obj = deser.deserialize(path);
name = obj.getValue("m_Name");
} catch (OutOfMemoryError ex) {
// Deserializer choked on an array size and clogged the heap, try
// to clean up this mess
deser = null;
System.gc();
} catch (Throwable ex) {
}
return name;
}
private final AssetFile asset;
private final Map<String, AssetExtractHandler> extractHandlerMap = new HashMap<>();
private ClassFilter cf;
private Path outputDir;
public AssetExtractor(AssetFile asset) {
this.asset = asset;
addHandler("AudioClip", new AudioClipHandler());
addHandler("Shader", new TextAssetHandler("shader"));
addHandler("SubstanceArchive", new SubstanceArchiveHandler());
addHandler("Texture2D", new Texture2DHandler());
addHandler("Cubemap", new Texture2DHandler());
addHandler("Font", new FontHandler());
addHandler("TextAsset", new TextAssetHandler("txt"));
addHandler("MovieTexture", new MovieTextureHandler());
addHandler("Mesh", new MeshHandler());
}
public final void addHandler(String className, AssetExtractHandler handler) {
handler.setClassName(className);
extractHandlerMap.put(className, handler);
}
public final AssetExtractHandler getHandler(String className) {
return extractHandlerMap.get(className);
}
public final void clearHandlers() {
extractHandlerMap.clear();
}
public Path getOutputDir() {
return outputDir;
}
public void setOutputDir(Path outputDir) {
this.outputDir = outputDir;
}
public ClassFilter getClassFilter() {
return cf;
}
public void setClassFilter(ClassFilter cf) {
this.cf = cf;
}
public void extract(boolean raw) throws IOException {
List<ObjectPath> paths = asset.getPaths();
Deserializer deser = new Deserializer(asset);
for (AssetExtractHandler extractHandler : extractHandlerMap.values()) {
extractHandler.setAssetFile(asset);
extractHandler.setOutputDir(outputDir);
}
for (ObjectPath path : paths) {
// skip filtered classes
if (cf != null && !cf.accept(path)) {
continue;
}
String className = ClassID.getNameForID(path.getClassID(), true);
// write just the serialized object data or parsed and extracted content?
if (raw) {
String assetFileName = String.format("%06d.bin", path.getPathID());
Path classDir = outputDir.resolve(className);
if (Files.notExists(classDir)) {
Files.createDirectories(classDir);
}
Path assetFile = classDir.resolve(assetFileName);
L.log(Level.INFO, "Writing {0} {1}", new Object[] {className, assetFileName});
ByteBuffer bbAsset = asset.getPathBuffer(path);
try {
ByteBufferUtils.save(assetFile, bbAsset);
} catch (Exception ex) {
L.log(Level.WARNING, "Can't write " + path + " to " + assetFile, ex);
}
} else {
AssetExtractHandler handler = getHandler(className);
UnityObject obj;
try {
obj = deser.deserialize(path);
} catch (Exception ex) {
L.log(Level.WARNING, "Can't deserialize " + path, ex);
continue;
}
if (handler != null) {
//UnityObject obj;
try {
handler.setObjectPath(path);
handler.extract(obj);
} catch (Exception ex) {
L.log(Level.WARNING, "Can't extract " + path, ex);
}
}
}
}
}
public void split() throws IOException {
List<ObjectPath> pathTable = asset.getPaths();
TypeTree typeTree = asset.getTypeTree();
// assets with just one object can't be split any further
if (pathTable.size() == 1) {
L.warning("Asset doesn't contain sub-assets!");
return;
}
for (ObjectPath path : pathTable) {
// skip filtered classes
if (cf != null && !cf.accept(path)) {
continue;
}
String className = ClassID.getNameForID(path.getClassID(), true);
AssetFile subAsset = new AssetFile();
subAsset.getHeader().setFormat(asset.getHeader().getFormat());
ObjectPath subFieldPath = new ObjectPath();
subFieldPath.setClassID1(path.getClassID1());
subFieldPath.setClassID2(path.getClassID2());
subFieldPath.setLength(path.getLength());
subFieldPath.setOffset(0);
subFieldPath.setPathID(1);
subAsset.getPaths().add(subFieldPath);
TypeTree subTypeTree = subAsset.getTypeTree();
subTypeTree.setEngineVersion(typeTree.getEngineVersion());
subTypeTree.setVersion(-2);
subTypeTree.setFormat(typeTree.getFormat());
subTypeTree.getFields().put(path.getClassID(), typeTree.getFields().get(path.getClassID()));
subAsset.setDataBuffer(asset.getPathBuffer(path));
Path subAssetDir = outputDir.resolve(className);
if (Files.notExists(subAssetDir)) {
Files.createDirectories(subAssetDir);
}
// probe asset name
String subAssetName = getObjectName(asset, path);
if (subAssetName != null) {
// remove any chars that could cause troubles on various file systems
subAssetName = FilenameSanitizer.sanitizeName(subAssetName);
} else {
// use numeric names
subAssetName = String.format("%06d", path.getPathID());
}
subAssetName += ".asset";
Path subAssetFile = subAssetDir.resolve(subAssetName);
if (Files.notExists(subAssetFile)) {
L.log(Level.INFO, "Writing {0}", subAssetFile);
subAsset.save(subAssetFile);
}
}
}
}
| unlicense |
campill0/connectin | ConnectInWeb/src/dao/NotificacionDAO.java | 673 | package dao;
import java.util.Date;
import java.util.List;
import beans.Mensaje;
import beans.Notificacion;
import beans.Peticion;
import beans.TipoNotificacion;
import beans.Usuario;
import dao.DAOException;
public interface NotificacionDAO {
public List findAll()throws DAOException;
public Notificacion findNotificacion(Long id)throws DAOException;
public void update(Notificacion n)throws DAOException;
public Notificacion createNotificacion(String descripcion, Date fecha,
TipoNotificacion tipo, Usuario receptorNotificacion,
Peticion peticion, Mensaje mensaje) throws DAOException;
public List findAll(Usuario usuario) throws DAOException;
}
| unlicense |
domessina/StorySummary | app/src/main/java/schn/beme/storysummary/narrativecomponent/Scene.java | 2457 | package schn.beme.storysummary.narrativecomponent;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.j256.ormlite.field.DataType;
import com.j256.ormlite.field.DatabaseField;
/**
* Created by Dorito on 25-07-16.
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public class Scene extends NarrativeComponent {
@DatabaseField(generatedId = true, columnName = "id")
public int id;
@JsonProperty("id")
@DatabaseField(columnName = "server_id", defaultValue = "-1")
public Integer serverId;
@JsonIgnore
@DatabaseField(columnName = "chapter_id",
canBeNull = false,foreign = true,
foreignAutoRefresh = false,
columnDefinition = "integer references chapter(id) on delete cascade")//see third note of foreignautorefresh doc maxForeignAutoRefreshLevel = 1
public Chapter chapterId;
@JsonProperty("chapterId")
public int chapterIdForSync;
@JsonIgnore
@DatabaseField(columnName = "diagram_id",
canBeNull = false, foreign = true,
foreignAutoRefresh = false,
columnDefinition = "integer references diagram(id) on delete cascade")
public Diagram diagramId;
@JsonProperty("diagramId")
public int diagramIdForSync;
@JsonProperty("place")
@DatabaseField(columnName = "position") //TODO rajouter canbeNull=false
public int position;
@JsonProperty("tag")//on server side it's tag and not title
@DatabaseField(columnName = "title")
public String title;
@JsonProperty("note")
@DatabaseField(columnName = "note",dataType = DataType.LONG_STRING)
public String note;
@JsonProperty("picture")
@DatabaseField(columnName = "picture")
public String picture;
public Scene(int id){this.id=id;}
public Scene(int id, Chapter chapterId, Diagram diagramId, int position, String title, String note, String picture){
this.id=id;
this.chapterId=chapterId;
this.diagramId=diagramId;
this.position=position;
this.title=title;
this.note=note;
this.picture=picture;
}
public Scene(){}
@Override
public boolean equals(Object obj) {
if(obj==this)
return true;
else if(this.id==((Scene)obj).id)
return true;
else
return false;
}
}
| unlicense |
jorisdgff/Trade-Today | Framework/src/nl/m4jit/framework/sqlaccess/TableManager.java | 1736 | package nl.m4jit.framework.sqlaccess;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.persistence.*;
public class TableManager {
private final String PERSISTENCE_UNIT_NAME = "CommonPU";
private EntityManager em;
private static TableManager instance;
private TableManager(){
try {
Properties properties = new Properties();
properties.load(new FileInputStream("files/props.properties"));
String host = properties.getProperty("host");
String database = properties.getProperty("database");
String user = properties.getProperty("user");
String password = properties.getProperty("password");
String port = properties.getProperty("port");
properties.put("javax.persistence.jdbc.url", "jdbc:mysql://" + host + ":" + port + "/" + database + "?zeroDateTimeBehavior=convertToNull");
properties.put("javax.persistence.jdbc.user", user);
properties.put("javax.persistence.jdbc.password", password);
EntityManagerFactory factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
em = factory.createEntityManager();
} catch (IOException ex) {
throw new Error(ex);
}
}
public EntityManager getEntityManager(){
return em;
}
public static TableManager getInstance(){
if(instance == null){
instance = new TableManager();
}
return instance;
}
}
| unlicense |
dkandalov/katas | java/src/main/java/katas/java/util/Arcade.java | 97 | package katas.java.util;
/**
* User: dima
* Date: 23/05/2012
*/
public @interface Arcade {
}
| unlicense |
WALDOISCOMING/Java_Study | Java_BP/src/Chap09/StringTokenizerExample1.java | 441 | package Chap09;
import java.util.StringTokenizer;
/*
* ÀÛ¼ºÀÏÀÚ:2017_03_13
* ÀÛ¼ºÀÚ:±æ°æ¿Ï
* StringTokenizer¸¦ ÀÌ¿ëÇØ¼ ¹®ÀÚ¿·ÎºÎÅÍ ÅäÅ«À» ºÐ¸®ÇÏ´Â ÇÁ·Î±×·¥
* ¿¹Á¦ 9-10
*/
public class StringTokenizerExample1 {
public static void main(String[] args){
StringTokenizer stok = new StringTokenizer("»ç°ú ¹è º¹¼þ¾Æ");
while(stok.hasMoreTokens()){
String str=stok.nextToken();
System.out.println(str);
}
}
}
| unlicense |
clilystudio/NetBook | allsrc/com/ximalaya/ting/android/opensdk/model/ranks/RankAlbumList.java | 1605 | package com.ximalaya.ting.android.opensdk.model.ranks;
import com.google.gson.annotations.SerializedName;
import com.ximalaya.ting.android.opensdk.datatrasfer.XimalayaResponse;
import com.ximalaya.ting.android.opensdk.model.album.Album;
import java.util.List;
public class RankAlbumList extends XimalayaResponse
{
@SerializedName("current_page")
private int currentPage;
@SerializedName("albums")
private List<Album> rankAlbumList;
@SerializedName("total_count")
private int totalCount;
@SerializedName("total_page")
private int totalPage;
public int getCurrentPage()
{
return this.currentPage;
}
public List<Album> getRankAlbumList()
{
return this.rankAlbumList;
}
public int getTotalCount()
{
return this.totalCount;
}
public int getTotalPage()
{
return this.totalPage;
}
public void setCurrentPage(int paramInt)
{
this.currentPage = paramInt;
}
public void setRankAlbumList(List<Album> paramList)
{
this.rankAlbumList = paramList;
}
public void setTotalCount(int paramInt)
{
this.totalCount = paramInt;
}
public void setTotalPage(int paramInt)
{
this.totalPage = paramInt;
}
public String toString()
{
return "RankAlbumList [totalPage=" + this.totalPage + ", totalCount=" + this.totalCount + ", currentPage=" + this.currentPage + ", rankAlbumList=" + this.rankAlbumList + "]";
}
}
/* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar
* Qualified Name: com.ximalaya.ting.android.opensdk.model.ranks.RankAlbumList
* JD-Core Version: 0.6.0
*/ | unlicense |
pra85/Android | Clickbutchangetext/gen/com/clickbutchangetext/BuildConfig.java | 164 | /** Automatically generated file. DO NOT MODIFY */
package com.clickbutchangetext;
public final class BuildConfig {
public final static boolean DEBUG = true;
} | unlicense |
thucoldwind/ucore_mips | Decaf/src/decaf/tree/Tree.java | 34995 | /**
* @(#)Tree.java 1.30 03/01/23
*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package decaf.tree;
import java.util.List;
import decaf.*;
import decaf.type.*;
import decaf.scope.*;
import decaf.symbol.*;
import decaf.symbol.Class;
import decaf.tac.Temp;
import decaf.utils.IndentPrintWriter;
import decaf.utils.MiscUtils;
/**
* Root class for abstract syntax tree nodes. It provides
* definitions for specific tree nodes as subclasses nested inside
* There are 40 such subclasses.
*
* Each subclass is highly standardized. It generally contains only tree
* fields for the syntactic subcomponents of the node. Some classes that
* represent identifier uses or definitions also define a
* Symbol field that denotes the represented identifier. Classes
* for non-local jumps also carry the jump target as a field. The root
* class Tree itself defines fields for the tree's type and
* position. No other fields are kept in a tree node; instead parameters
* are passed to methods accessing the node.
*
* The only method defined in subclasses is `visit' which applies a
* given visitor to the tree. The actual tree processing is done by
* visitor classes in other packages. The abstract class
* Visitor, as well as an Factory interface for trees, are
* defined as inner classes in Tree.
* @see TreeMaker
* @see TreeInfo
* @see TreeTranslator
* @see Pretty
*/
public abstract class Tree {
/**
* Toplevel nodes, of type TopLevel, representing entire source files.
*/
public static final int TOPLEVEL = 1;
/**
* Import clauses, of type Import.
*/
public static final int IMPORT = TOPLEVEL + 1;
/**
* Class definitions, of type ClassDef.
*/
public static final int CLASSDEF = IMPORT + 1;
/**
* Method definitions, of type MethodDef.
*/
public static final int METHODDEF = CLASSDEF + 1;
/**
* Variable definitions, of type VarDef.
*/
public static final int VARDEF = METHODDEF + 1;
/**
* The no-op statement ";", of type Skip
*/
public static final int SKIP = VARDEF + 1;
/**
* Blocks, of type Block.
*/
public static final int BLOCK = SKIP + 1;
/**
* Do-while loops, of type DoLoop.
*/
public static final int DOLOOP = BLOCK + 1;
/**
* While-loops, of type WhileLoop.
*/
public static final int WHILELOOP = DOLOOP + 1;
/**
* For-loops, of type ForLoop.
*/
public static final int FORLOOP = WHILELOOP + 1;
/**
* Labelled statements, of type Labelled.
*/
public static final int LABELLED = FORLOOP + 1;
/**
* Switch statements, of type Switch.
*/
public static final int SWITCH = LABELLED + 1;
/**
* Case parts in switch statements, of type Case.
*/
public static final int CASE = SWITCH + 1;
/**
* Synchronized statements, of type Synchonized.
*/
public static final int SYNCHRONIZED = CASE + 1;
/**
* Try statements, of type Try.
*/
public static final int TRY = SYNCHRONIZED + 1;
/**
* Catch clauses in try statements, of type Catch.
*/
public static final int CATCH = TRY + 1;
/**
* Conditional expressions, of type Conditional.
*/
public static final int CONDEXPR = CATCH + 1;
/**
* Conditional statements, of type If.
*/
public static final int IF = CONDEXPR + 1;
/**
* Expression statements, of type Exec.
*/
public static final int EXEC = IF + 1;
/**
* Break statements, of type Break.
*/
public static final int BREAK = EXEC + 1;
/**
* Continue statements, of type Continue.
*/
public static final int CONTINUE = BREAK + 1;
/**
* Return statements, of type Return.
*/
public static final int RETURN = CONTINUE + 1;
/**
* Throw statements, of type Throw.
*/
public static final int THROW = RETURN + 1;
/**
* Assert statements, of type Assert.
*/
public static final int ASSERT = THROW + 1;
/**
* Method invocation expressions, of type Apply.
*/
public static final int APPLY = ASSERT + 1;
/**
* Class instance creation expressions, of type NewClass.
*/
public static final int NEWCLASS = APPLY + 1;
/**
* Array creation expressions, of type NewArray.
*/
public static final int NEWARRAY = NEWCLASS + 1;
/**
* Parenthesized subexpressions, of type Parens.
*/
public static final int PARENS = NEWARRAY + 1;
/**
* Assignment expressions, of type Assign.
*/
public static final int ASSIGN = PARENS + 1;
/**
* Type cast expressions, of type TypeCast.
*/
public static final int TYPECAST = ASSIGN + 1;
/**
* Type test expressions, of type TypeTest.
*/
public static final int TYPETEST = TYPECAST + 1;
/**
* Indexed array expressions, of type Indexed.
*/
public static final int INDEXED = TYPETEST + 1;
/**
* Selections, of type Select.
*/
public static final int SELECT = INDEXED + 1;
/**
* Simple identifiers, of type Ident.
*/
public static final int IDENT = SELECT + 1;
/**
* Literals, of type Literal.
*/
public static final int LITERAL = IDENT + 1;
/**
* Basic type identifiers, of type TypeIdent.
*/
public static final int TYPEIDENT = LITERAL + 1;
/**
* Class types, of type TypeClass.
*/
public static final int TYPECLASS = TYPEIDENT + 1;
/**
* Array types, of type TypeArray.
*/
public static final int TYPEARRAY = TYPECLASS + 1;
/**
* Parameterized types, of type TypeApply.
*/
public static final int TYPEAPPLY = TYPEARRAY + 1;
/**
* Formal type parameters, of type TypeParameter.
*/
public static final int TYPEPARAMETER = TYPEAPPLY + 1;
/**
* Error trees, of type Erroneous.
*/
public static final int ERRONEOUS = TYPEPARAMETER + 1;
/**
* Unary operators, of type Unary.
*/
public static final int POS = ERRONEOUS + 1;
public static final int NEG = POS + 1;
public static final int NOT = NEG + 1;
public static final int COMPL = NOT + 1;
public static final int PREINC = COMPL + 1;
public static final int PREDEC = PREINC + 1;
public static final int POSTINC = PREDEC + 1;
public static final int POSTDEC = POSTINC + 1;
/**
* unary operator for null reference checks, only used internally.
*/
public static final int NULLCHK = POSTDEC + 1;
/**
* Binary operators, of type Binary.
*/
public static final int OR = NULLCHK + 1;
public static final int AND = OR + 1;
public static final int BITOR = AND + 1;
public static final int BITXOR = BITOR + 1;
public static final int BITAND = BITXOR + 1;
public static final int EQ = BITAND + 1;
public static final int NE = EQ + 1;
public static final int LT = NE + 1;
public static final int GT = LT + 1;
public static final int LE = GT + 1;
public static final int GE = LE + 1;
public static final int SL = GE + 1;
public static final int SR = SL + 1;
public static final int USR = SR + 1;
public static final int PLUS = USR + 1;
public static final int MINUS = PLUS + 1;
public static final int MUL = MINUS + 1;
public static final int DIV = MUL + 1;
public static final int MOD = DIV + 1;
public static final int NULL = MOD + 1;
public static final int CALLEXPR = NULL + 1;
public static final int THISEXPR = CALLEXPR + 1;
public static final int READINTEXPR = THISEXPR + 1;
public static final int READLINEEXPR = READINTEXPR + 1;
public static final int PRINT = READLINEEXPR + 1;
/**
* Tags for Literal and TypeLiteral
*/
public static final int VOID = 0;
public static final int INT = VOID + 1;
public static final int BOOL = INT + 1;
public static final int STRING = BOOL + 1;
public Location loc;
public Type type;
public int tag;
/**
* Initialize tree with given tag.
*/
public Tree(int tag, Location loc) {
super();
this.tag = tag;
this.loc = loc;
}
public Location getLocation() {
return loc;
}
/**
* Set type field and return this tree.
*/
public Tree setType(Type type) {
this.type = type;
return this;
}
/**
* Visit this tree with a given visitor.
*/
public void accept(Visitor v) {
v.visitTree(this);
}
public abstract void printTo(IndentPrintWriter pw);
public static class TopLevel extends Tree {
public List<ClassDef> classes;
public Class main;
public GlobalScope globalScope;
public TopLevel(List<ClassDef> classes, Location loc) {
super(TOPLEVEL, loc);
this.classes = classes;
}
@Override
public void accept(Visitor v) {
v.visitTopLevel(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("program");
pw.incIndent();
for (ClassDef d : classes) {
d.printTo(pw);
}
pw.decIndent();
}
}
public static class ClassDef extends Tree {
public String name;
public String parent;
public List<Tree> fields;
public Class symbol;
public ClassDef(String name, String parent, List<Tree> fields,
Location loc) {
super(CLASSDEF, loc);
this.name = name;
this.parent = parent;
this.fields = fields;
}
@Override
public void accept(Visitor v) {
v.visitClassDef(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("class " + name + " "
+ (parent != null ? parent : "<empty>"));
pw.incIndent();
for (Tree f : fields) {
f.printTo(pw);
}
pw.decIndent();
}
}
public static class MethodDef extends Tree {
public boolean statik;
public String name;
public TypeLiteral returnType;
public List<VarDef> formals;
public Block body;
public Function symbol;
public MethodDef(boolean statik, String name, TypeLiteral returnType,
List<VarDef> formals, Block body, Location loc) {
super(METHODDEF, loc);
this.statik = statik;
this.name = name;
this.returnType = returnType;
this.formals = formals;
this.body = body;
}
public void accept(Visitor v) {
v.visitMethodDef(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
if (statik) {
pw.print("static ");
}
pw.print("func " + name + " ");
returnType.printTo(pw);
pw.println();
pw.incIndent();
pw.println("formals");
pw.incIndent();
for (VarDef d : formals) {
d.printTo(pw);
}
pw.decIndent();
body.printTo(pw);
pw.decIndent();
}
}
public static class VarDef extends Tree {
public String name;
public TypeLiteral type;
public Variable symbol;
public VarDef(String name, TypeLiteral type, Location loc) {
super(VARDEF, loc);
this.name = name;
this.type = type;
}
@Override
public void accept(Visitor v) {
v.visitVarDef(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.print("vardef " + name + " ");
type.printTo(pw);
pw.println();
}
}
/**
* A no-op statement ";".
*/
public static class Skip extends Tree {
public Skip(Location loc) {
super(SKIP, loc);
}
@Override
public void accept(Visitor v) {
v.visitSkip(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
//print nothing
}
}
public static class Block extends Tree {
public List<Tree> block;
public LocalScope associatedScope;
public Block(List<Tree> block, Location loc) {
super(BLOCK, loc);
this.block = block;
}
@Override
public void accept(Visitor v) {
v.visitBlock(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("stmtblock");
pw.incIndent();
for (Tree s : block) {
s.printTo(pw);
}
pw.decIndent();
}
}
/**
* A while loop
*/
public static class WhileLoop extends Tree {
public Expr condition;
public Tree loopBody;
public WhileLoop(Expr condition, Tree loopBody, Location loc) {
super(WHILELOOP, loc);
this.condition = condition;
this.loopBody = loopBody;
}
@Override
public void accept(Visitor v) {
v.visitWhileLoop(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("while");
pw.incIndent();
condition.printTo(pw);
if (loopBody != null) {
loopBody.printTo(pw);
}
pw.decIndent();
}
}
/**
* A for loop.
*/
public static class ForLoop extends Tree {
public Tree init;
public Expr condition;
public Tree update;
public Tree loopBody;
public ForLoop(Tree init, Expr condition, Tree update,
Tree loopBody, Location loc) {
super(FORLOOP, loc);
this.init = init;
this.condition = condition;
this.update = update;
this.loopBody = loopBody;
}
@Override
public void accept(Visitor v) {
v.visitForLoop(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("for");
pw.incIndent();
if (init != null) {
init.printTo(pw);
} else {
pw.println("<emtpy>");
}
condition.printTo(pw);
if (update != null) {
update.printTo(pw);
} else {
pw.println("<empty>");
}
if (loopBody != null) {
loopBody.printTo(pw);
}
pw.decIndent();
}
}
/**
* An "if ( ) { } else { }" block
*/
public static class If extends Tree {
public Expr condition;
public Tree trueBranch;
public Tree falseBranch;
public If(Expr condition, Tree trueBranch, Tree falseBranch,
Location loc) {
super(IF, loc);
this.condition = condition;
this.trueBranch = trueBranch;
this.falseBranch = falseBranch;
}
@Override
public void accept(Visitor v) {
v.visitIf(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("if");
pw.incIndent();
condition.printTo(pw);
if (trueBranch != null) {
trueBranch.printTo(pw);
}
pw.decIndent();
if (falseBranch != null) {
pw.println("else");
pw.incIndent();
falseBranch.printTo(pw);
pw.decIndent();
}
}
}
/**
* an expression statement
* @param expr expression structure
*/
public static class Exec extends Tree {
public Expr expr;
public Exec(Expr expr, Location loc) {
super(EXEC, loc);
this.expr = expr;
}
@Override
public void accept(Visitor v) {
v.visitExec(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
expr.printTo(pw);
}
}
/**
* A break from a loop.
*/
public static class Break extends Tree {
public Break(Location loc) {
super(BREAK, loc);
}
@Override
public void accept(Visitor v) {
v.visitBreak(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("break");
}
}
/**
* A return statement.
*/
public static class Print extends Tree {
public List<Expr> exprs;
public Print(List<Expr> exprs, Location loc) {
super(PRINT, loc);
this.exprs = exprs;
}
@Override
public void accept(Visitor v) {
v.visitPrint(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("print");
pw.incIndent();
for (Expr e : exprs) {
e.printTo(pw);
}
pw.decIndent();
}
}
/**
* A return statement.
*/
public static class Return extends Tree {
public Expr expr;
public Return(Expr expr, Location loc) {
super(RETURN, loc);
this.expr = expr;
}
@Override
public void accept(Visitor v) {
v.visitReturn(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("return");
if (expr != null) {
pw.incIndent();
expr.printTo(pw);
pw.decIndent();
}
}
}
public abstract static class Expr extends Tree {
public Type type;
public Temp val;
public boolean isClass;
public boolean usedForRef;
public Expr(int tag, Location loc) {
super(tag, loc);
}
}
/**
* A method invocation
*/
public static class Apply extends Expr {
public Expr receiver;
public String method;
public List<Expr> actuals;
public Function symbol;
public boolean isArrayLength;
public Apply(Expr receiver, String method, List<Expr> actuals,
Location loc) {
super(APPLY, loc);
this.receiver = receiver;
this.method = method;
this.actuals = actuals;
}
@Override
public void accept(Visitor v) {
v.visitApply(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("call " + method);
pw.incIndent();
if (receiver != null) {
receiver.printTo(pw);
} else {
pw.println("<empty>");
}
for (Expr e : actuals) {
e.printTo(pw);
}
pw.decIndent();
}
}
/**
* A new(...) operation.
*/
public static class NewClass extends Expr {
public String className;
public Class symbol;
public NewClass(String className, Location loc) {
super(NEWCLASS, loc);
this.className = className;
}
@Override
public void accept(Visitor v) {
v.visitNewClass(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("newobj " + className);
}
}
/**
* A new[...] operation.
*/
public static class NewArray extends Expr {
public TypeLiteral elementType;
public Expr length;
public NewArray(TypeLiteral elementType, Expr length, Location loc) {
super(NEWARRAY, loc);
this.elementType = elementType;
this.length = length;
}
@Override
public void accept(Visitor v) {
v.visitNewArray(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.print("newarray ");
elementType.printTo(pw);
pw.println();
pw.incIndent();
length.printTo(pw);
pw.decIndent();
}
}
public abstract static class LValue extends Expr {
public enum Kind {
LOCAL_VAR, PARAM_VAR, MEMBER_VAR, ARRAY_ELEMENT
}
public Kind lvKind;
LValue(int tag, Location loc) {
super(tag, loc);
}
}
/**
* A assignment with "=".
*/
public static class Assign extends Tree {
public LValue left;
public Expr expr;
public Assign(LValue left, Expr expr, Location loc) {
super(ASSIGN, loc);
this.left = left;
this.expr = expr;
}
@Override
public void accept(Visitor v) {
v.visitAssign(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("assign");
pw.incIndent();
left.printTo(pw);
expr.printTo(pw);
pw.decIndent();
}
}
/**
* A unary operation.
*/
public static class Unary extends Expr {
public Expr expr;
public Unary(int kind, Expr expr, Location loc) {
super(kind, loc);
this.expr = expr;
}
private void unaryOperatorToString(IndentPrintWriter pw, String op) {
pw.println(op);
pw.incIndent();
expr.printTo(pw);
pw.decIndent();
}
@Override
public void accept(Visitor v) {
v.visitUnary(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
switch (tag) {
case NEG:
unaryOperatorToString(pw, "neg");
break;
case NOT:
unaryOperatorToString(pw, "not");
break;
}
}
}
/**
* A binary operation.
*/
public static class Binary extends Expr {
public Expr left;
public Expr right;
public Binary(int kind, Expr left, Expr right, Location loc) {
super(kind, loc);
this.left = left;
this.right = right;
}
private void binaryOperatorPrintTo(IndentPrintWriter pw, String op) {
pw.println(op);
pw.incIndent();
left.printTo(pw);
right.printTo(pw);
pw.decIndent();
}
@Override
public void accept(Visitor visitor) {
visitor.visitBinary(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
switch (tag) {
case PLUS:
binaryOperatorPrintTo(pw, "add");
break;
case MINUS:
binaryOperatorPrintTo(pw, "sub");
break;
case MUL:
binaryOperatorPrintTo(pw, "mul");
break;
case DIV:
binaryOperatorPrintTo(pw, "div");
break;
case MOD:
binaryOperatorPrintTo(pw, "mod");
break;
case AND:
binaryOperatorPrintTo(pw, "and");
break;
case OR:
binaryOperatorPrintTo(pw, "or");
break;
case EQ:
binaryOperatorPrintTo(pw, "equ");
break;
case NE:
binaryOperatorPrintTo(pw, "neq");
break;
case LT:
binaryOperatorPrintTo(pw, "les");
break;
case LE:
binaryOperatorPrintTo(pw, "leq");
break;
case GT:
binaryOperatorPrintTo(pw, "gtr");
break;
case GE:
binaryOperatorPrintTo(pw, "geq");
break;
}
}
}
public static class CallExpr extends Expr {
public Expr receiver;
public String method;
public List<Expr> actuals;
public Function symbol;
public boolean isArrayLength;
public CallExpr(Expr receiver, String method, List<Expr> actuals,
Location loc) {
super(CALLEXPR, loc);
this.receiver = receiver;
this.method = method;
this.actuals = actuals;
}
@Override
public void accept(Visitor visitor) {
visitor.visitCallExpr(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("call " + method);
pw.incIndent();
if (receiver != null) {
receiver.printTo(pw);
} else {
pw.println("<empty>");
}
for (Expr e : actuals) {
e.printTo(pw);
}
pw.decIndent();
}
}
public static class ReadIntExpr extends Expr {
public ReadIntExpr(Location loc) {
super(READINTEXPR, loc);
}
@Override
public void accept(Visitor visitor) {
visitor.visitReadIntExpr(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("readint");
}
}
public static class ReadLineExpr extends Expr {
public ReadLineExpr(Location loc) {
super(READLINEEXPR, loc);
}
@Override
public void accept(Visitor visitor) {
visitor.visitReadLineExpr(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("readline");
}
}
public static class ThisExpr extends Expr {
public ThisExpr(Location loc) {
super(THISEXPR, loc);
}
@Override
public void accept(Visitor visitor) {
visitor.visitThisExpr(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("this");
}
}
/**
* A type cast.
*/
public static class TypeCast extends Expr {
public String className;
public Expr expr;
public Class symbol;
public TypeCast(String className, Expr expr, Location loc) {
super(TYPECAST, loc);
this.className = className;
this.expr = expr;
}
@Override
public void accept(Visitor v) {
v.visitTypeCast(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("classcast");
pw.incIndent();
pw.println(className);
expr.printTo(pw);
pw.decIndent();
}
}
/**
* instanceof expression
*/
public static class TypeTest extends Expr {
public Expr instance;
public String className;
public Class symbol;
public TypeTest(Expr instance, String className, Location loc) {
super(TYPETEST, loc);
this.instance = instance;
this.className = className;
}
@Override
public void accept(Visitor v) {
v.visitTypeTest(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("instanceof");
pw.incIndent();
instance.printTo(pw);
pw.println(className);
pw.decIndent();
}
}
/**
* An array selection
*/
public static class Indexed extends LValue {
public Expr array;
public Expr index;
public Indexed(Expr array, Expr index, Location loc) {
super(INDEXED, loc);
this.array = array;
this.index = index;
}
@Override
public void accept(Visitor v) {
v.visitIndexed(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("arrref");
pw.incIndent();
array.printTo(pw);
index.printTo(pw);
pw.decIndent();
}
}
/**
* An identifier
*/
public static class Ident extends LValue {
public Expr owner;
public String name;
public Variable symbol;
public boolean isDefined;
public Ident(Expr owner, String name, Location loc) {
super(IDENT, loc);
this.owner = owner;
this.name = name;
}
@Override
public void accept(Visitor v) {
v.visitIdent(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("varref " + name);
if (owner != null) {
pw.incIndent();
owner.printTo(pw);
pw.decIndent();
}
}
}
/**
* A constant value given literally.
* @param value value representation
*/
public static class Literal extends Expr {
public int typeTag;
public Object value;
public Literal(int typeTag, Object value, Location loc) {
super(LITERAL, loc);
this.typeTag = typeTag;
this.value = value;
}
@Override
public void accept(Visitor v) {
v.visitLiteral(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
switch (typeTag) {
case INT:
pw.println("intconst " + value);
break;
case BOOL:
pw.println("boolconst " + value);
break;
default:
pw.println("stringconst " + MiscUtils.quote((String)value));
}
}
}
public static class Null extends Expr {
public Null(Location loc) {
super(NULL, loc);
}
@Override
public void accept(Visitor v) {
v.visitNull(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.println("null");
}
}
public static abstract class TypeLiteral extends Tree {
public Type type;
public TypeLiteral(int tag, Location loc){
super(tag, loc);
}
}
/**
* Identifies a basic type.
* @param tag the basic type id
* @see SemanticConstants
*/
public static class TypeIdent extends TypeLiteral {
public int typeTag;
public TypeIdent(int typeTag, Location loc) {
super(TYPEIDENT, loc);
this.typeTag = typeTag;
}
@Override
public void accept(Visitor v) {
v.visitTypeIdent(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
switch (typeTag){
case INT:
pw.print("inttype");
break;
case BOOL:
pw.print("booltype");
break;
case VOID:
pw.print("voidtype");
break;
default:
pw.print("stringtype");
}
}
}
public static class TypeClass extends TypeLiteral {
public String name;
public TypeClass(String name, Location loc) {
super(TYPECLASS, loc);
this.name = name;
}
@Override
public void accept(Visitor visitor) {
visitor.visitTypeClass(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.print("classtype " + name);
}
}
/**
* An array type, A[]
*/
public static class TypeArray extends TypeLiteral {
public TypeLiteral elementType;
public TypeArray(TypeLiteral elementType, Location loc) {
super(TYPEARRAY, loc);
this.elementType = elementType;
}
@Override
public void accept(Visitor v) {
v.visitTypeArray(this);
}
@Override
public void printTo(IndentPrintWriter pw) {
pw.print("arrtype ");
elementType.printTo(pw);
}
}
/**
* A generic visitor class for trees.
*/
public static abstract class Visitor {
public Visitor() {
super();
}
public void visitTopLevel(TopLevel that) {
visitTree(that);
}
public void visitClassDef(ClassDef that) {
visitTree(that);
}
public void visitMethodDef(MethodDef that) {
visitTree(that);
}
public void visitVarDef(VarDef that) {
visitTree(that);
}
public void visitSkip(Skip that) {
visitTree(that);
}
public void visitBlock(Block that) {
visitTree(that);
}
public void visitWhileLoop(WhileLoop that) {
visitTree(that);
}
public void visitForLoop(ForLoop that) {
visitTree(that);
}
public void visitIf(If that) {
visitTree(that);
}
public void visitExec(Exec that) {
visitTree(that);
}
public void visitBreak(Break that) {
visitTree(that);
}
public void visitReturn(Return that) {
visitTree(that);
}
public void visitApply(Apply that) {
visitTree(that);
}
public void visitNewClass(NewClass that) {
visitTree(that);
}
public void visitNewArray(NewArray that) {
visitTree(that);
}
public void visitAssign(Assign that) {
visitTree(that);
}
public void visitUnary(Unary that) {
visitTree(that);
}
public void visitBinary(Binary that) {
visitTree(that);
}
public void visitCallExpr(CallExpr that) {
visitTree(that);
}
public void visitReadIntExpr(ReadIntExpr that) {
visitTree(that);
}
public void visitReadLineExpr(ReadLineExpr that) {
visitTree(that);
}
public void visitPrint(Print that) {
visitTree(that);
}
public void visitThisExpr(ThisExpr that) {
visitTree(that);
}
public void visitLValue(LValue that) {
visitTree(that);
}
public void visitTypeCast(TypeCast that) {
visitTree(that);
}
public void visitTypeTest(TypeTest that) {
visitTree(that);
}
public void visitIndexed(Indexed that) {
visitTree(that);
}
public void visitIdent(Ident that) {
visitTree(that);
}
public void visitLiteral(Literal that) {
visitTree(that);
}
public void visitNull(Null that) {
visitTree(that);
}
public void visitTypeIdent(TypeIdent that) {
visitTree(that);
}
public void visitTypeClass(TypeClass that) {
visitTree(that);
}
public void visitTypeArray(TypeArray that) {
visitTree(that);
}
public void visitTree(Tree that) {
assert false;
}
}
}
| unlicense |
Gopi006/FastRaq | bean/Example.java | 2454 | package com.securecloud.bean;
import java.io.Serializable;
// Setters and getters for Bean
public class Example implements Serializable {
private static final long serialVersionUID = 1L;
private String string;
private int fileid;
private int sid;
private String keyword;
private int count;
private int size;
public int getSize() {
return size;
}
public void setSize(int size) {
this.size = size;
}
private String fileIds;
public int getFileid() {
return fileid;
}
public void setFileid(int fileid) {
this.fileid = fileid;
}
public String getString() {
return string;
}
public void setString(String a) {
this.string = a;
}
public int getSid() {
return sid;
}
public void setSid(int sid) {
this.sid = sid;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public int getCount() {
return count;
}
public void setCount(int count) {
this.count = count;
}
public String getFileIds() {
return fileIds;
}
public void setFileIds(String fileIds) {
this.fileIds = fileIds;
}
public String getAc2() {
return ac2;
}
public void setAc2(String ac2) {
this.ac2 = ac2;
}
public String getAc3() {
return ac3;
}
public void setAc3(String ac3) {
this.ac3 = ac3;
}
public String getAc4() {
return ac4;
}
public void setAc4(String ac4) {
this.ac4 = ac4;
}
public String getAc5() {
return ac5;
}
public void setAc5(String ac5) {
this.ac5 = ac5;
}
public String getTc1() {
return tc1;
}
public void setTc1(String tc1) {
this.tc1 = tc1;
}
public String getTc2() {
return tc2;
}
public void setTc2(String tc2) {
this.tc2 = tc2;
}
public String getTc3() {
return tc3;
}
public void setTc3(String tc3) {
this.tc3 = tc3;
}
public String getTc4() {
return tc4;
}
public void setTc4(String tc4) {
this.tc4 = tc4;
}
public String getTc5() {
return tc5;
}
public void setTc5(String tc5) {
this.tc5 = tc5;
}
public static long getSerialversionuid() {
return serialVersionUID;
}
private String ac2;
private String ac3;
private String ac4;
private String ac5;
private String tc1;
private String tc2;
private String tc3;
private String tc4;
private String tc5;
}
| unlicense |
clilystudio/NetBook | allsrc/android/support/v4/view/accessibility/AccessibilityManagerCompat$AccessibilityManagerVersionImpl.java | 1516 | package android.support.v4.view.accessibility;
import android.accessibilityservice.AccessibilityServiceInfo;
import android.view.accessibility.AccessibilityManager;
import java.util.List;
abstract interface AccessibilityManagerCompat$AccessibilityManagerVersionImpl
{
public abstract boolean addAccessibilityStateChangeListener(AccessibilityManager paramAccessibilityManager, AccessibilityManagerCompat.AccessibilityStateChangeListenerCompat paramAccessibilityStateChangeListenerCompat);
public abstract List<AccessibilityServiceInfo> getEnabledAccessibilityServiceList(AccessibilityManager paramAccessibilityManager, int paramInt);
public abstract List<AccessibilityServiceInfo> getInstalledAccessibilityServiceList(AccessibilityManager paramAccessibilityManager);
public abstract boolean isTouchExplorationEnabled(AccessibilityManager paramAccessibilityManager);
public abstract Object newAccessiblityStateChangeListener(AccessibilityManagerCompat.AccessibilityStateChangeListenerCompat paramAccessibilityStateChangeListenerCompat);
public abstract boolean removeAccessibilityStateChangeListener(AccessibilityManager paramAccessibilityManager, AccessibilityManagerCompat.AccessibilityStateChangeListenerCompat paramAccessibilityStateChangeListenerCompat);
}
/* Location: E:\Progs\Dev\Android\Decompile\apktool\zssq\zssq-dex2jar.jar
* Qualified Name: android.support.v4.view.accessibility.AccessibilityManagerCompat.AccessibilityManagerVersionImpl
* JD-Core Version: 0.6.0
*/ | unlicense |
WALDOISCOMING/Java_Study | Java_BP/src/Chap10/DataInputExample1.java | 714 | package Chap10;
import java.io.*;
/*
* ÀÛ¼ºÀÏÀÚ:2017_03_14
* ÀÛ¼ºÀÚ:±æ°æ¿Ï
* DataInputStream Ŭ·¡½º »ç¿ë ¿¹¸¦ º¸¿©ÁÖ´Â ÇÁ·Î±×·¥
* ¿¹Á¦ 10-8
*/
public class DataInputExample1{
public static void main(String[] args){
DataInputStream in = null;
try{
in = new DataInputStream(
new FileInputStream("src/Chap10/output.dat"));
while(true){
int data = in.readInt();
System.out.println(data);
}
}
catch(EOFException e){
System.out.println(e+"³¡.");
}
catch(IOException e){
System.out.println(e+"ÆÄÀÏ·Î ÀÐÀ» ¼ö ¾ø½À´Ï´Ù,.");
}finally{
try{
in.close();
}catch(Exception e){
System.out.println(e);
}
}
}
}
| unlicense |
themodernway/themodernway-server-core | src/main/groovy/com/themodernway/server/core/servlet/filter/CompositeFilter.java | 2805 | /*
* Copyright (c) 2018, The Modern Way. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.themodernway.server.core.servlet.filter;
import java.io.IOException;
import java.util.List;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.themodernway.common.api.java.util.CommonOps;
public class CompositeFilter extends HTTPFilterBase
{
private final List<? extends Filter> m_filters;
public CompositeFilter(final List<? extends Filter> filters)
{
m_filters = CommonOps.requireNonNull(filters);
}
@Override
public void initialize() throws ServletException
{
for (final Filter filter : m_filters)
{
filter.init(getFilterConfig());
}
}
@Override
public void filter(final HttpServletRequest request, final HttpServletResponse response, final FilterChain chain) throws IOException, ServletException
{
new CompositeFilterChain(chain, m_filters).doFilter(request, response);
}
@Override
public void destroy()
{
for (final Filter filter : m_filters)
{
filter.destroy();
}
}
private static final class CompositeFilterChain implements FilterChain
{
private final FilterChain m_cochain;
private final List<? extends Filter> m_filters;
private int m_curposn = 0;
public CompositeFilterChain(final FilterChain cochain, final List<? extends Filter> filters)
{
m_cochain = cochain;
m_filters = filters;
}
@Override
public void doFilter(final ServletRequest request, final ServletResponse response) throws IOException, ServletException
{
if (m_curposn == m_filters.size())
{
m_cochain.doFilter(request, response);
}
else
{
m_curposn++;
m_filters.get(m_curposn - 1).doFilter(request, response, this);
}
}
}
}
| apache-2.0 |
illicitonion/buck | test/com/facebook/buck/cxx/CxxLinkTest.java | 8136 | /*
* Copyright 2014-present Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package com.facebook.buck.cxx;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import com.facebook.buck.model.BuildTarget;
import com.facebook.buck.model.BuildTargetFactory;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildRuleResolver;
import com.facebook.buck.rules.DefaultTargetNodeToBuildRuleTransformer;
import com.facebook.buck.rules.FakeBuildRuleParamsBuilder;
import com.facebook.buck.rules.FakeSourcePath;
import com.facebook.buck.rules.HashedFileTool;
import com.facebook.buck.rules.RuleKey;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.TargetGraph;
import com.facebook.buck.rules.args.Arg;
import com.facebook.buck.rules.args.SanitizedArg;
import com.facebook.buck.rules.args.SourcePathArg;
import com.facebook.buck.rules.args.StringArg;
import com.facebook.buck.rules.keys.DefaultRuleKeyBuilderFactory;
import com.facebook.buck.testutil.FakeFileHashCache;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableBiMap;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import org.junit.Test;
import java.io.File;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Optional;
public class CxxLinkTest {
private static final Linker DEFAULT_LINKER = new GnuLinker(new HashedFileTool(Paths.get("ld")));
private static final Path DEFAULT_OUTPUT = Paths.get("test.exe");
private static final SourcePathResolver DEFAULT_SOURCE_PATH_RESOLVER =
new SourcePathResolver(
new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer()));
private static final ImmutableList<Arg> DEFAULT_ARGS =
ImmutableList.of(
new StringArg("-rpath"),
new StringArg("/lib"),
new StringArg("libc.a"),
new SourcePathArg(DEFAULT_SOURCE_PATH_RESOLVER, new FakeSourcePath("a.o")),
new SourcePathArg(DEFAULT_SOURCE_PATH_RESOLVER, new FakeSourcePath("b.o")),
new SourcePathArg(DEFAULT_SOURCE_PATH_RESOLVER, new FakeSourcePath("libc.a")),
new StringArg("-L"),
new StringArg("/System/Libraries/libz.dynlib"),
new StringArg("-llibz.dylib"));
@Test
public void testThatInputChangesCauseRuleKeyChanges() {
SourcePathResolver pathResolver = new SourcePathResolver(
new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer())
);
BuildTarget target = BuildTargetFactory.newInstance("//foo:bar");
BuildRuleParams params = new FakeBuildRuleParamsBuilder(target).build();
FakeFileHashCache hashCache = FakeFileHashCache.createFromStrings(
ImmutableMap.of(
"ld", Strings.repeat("0", 40),
"a.o", Strings.repeat("a", 40),
"b.o", Strings.repeat("b", 40),
"libc.a", Strings.repeat("c", 40),
"different", Strings.repeat("d", 40)));
// Generate a rule key for the defaults.
RuleKey defaultRuleKey = new DefaultRuleKeyBuilderFactory(0, hashCache, pathResolver).build(
new CxxLink(
params,
pathResolver,
DEFAULT_LINKER,
DEFAULT_OUTPUT,
DEFAULT_ARGS,
Optional.empty(),
/* cacheable */ true));
// Verify that changing the archiver causes a rulekey change.
RuleKey linkerChange = new DefaultRuleKeyBuilderFactory(0, hashCache, pathResolver).build(
new CxxLink(
params,
pathResolver,
new GnuLinker(new HashedFileTool(Paths.get("different"))),
DEFAULT_OUTPUT,
DEFAULT_ARGS,
Optional.empty(),
/* cacheable */ true));
assertNotEquals(defaultRuleKey, linkerChange);
// Verify that changing the output path causes a rulekey change.
RuleKey outputChange = new DefaultRuleKeyBuilderFactory(0, hashCache, pathResolver).build(
new CxxLink(
params,
pathResolver,
DEFAULT_LINKER,
Paths.get("different"),
DEFAULT_ARGS,
Optional.empty(),
/* cacheable */ true));
assertNotEquals(defaultRuleKey, outputChange);
// Verify that changing the flags causes a rulekey change.
RuleKey flagsChange = new DefaultRuleKeyBuilderFactory(0, hashCache, pathResolver).build(
new CxxLink(
params,
pathResolver,
DEFAULT_LINKER,
DEFAULT_OUTPUT,
ImmutableList.of(
new SourcePathArg(
new SourcePathResolver(
new BuildRuleResolver(
TargetGraph.EMPTY,
new DefaultTargetNodeToBuildRuleTransformer())),
new FakeSourcePath("different"))),
Optional.empty(),
/* cacheable */ true));
assertNotEquals(defaultRuleKey, flagsChange);
}
@Test
public void sanitizedPathsInFlagsDoNotAffectRuleKey() {
SourcePathResolver pathResolver = new SourcePathResolver(
new BuildRuleResolver(TargetGraph.EMPTY, new DefaultTargetNodeToBuildRuleTransformer())
);
BuildTarget target = BuildTargetFactory.newInstance("//foo:bar");
BuildRuleParams params = new FakeBuildRuleParamsBuilder(target).build();
DefaultRuleKeyBuilderFactory ruleKeyBuilderFactory =
new DefaultRuleKeyBuilderFactory(
0,
FakeFileHashCache.createFromStrings(
ImmutableMap.of(
"ld", Strings.repeat("0", 40),
"a.o", Strings.repeat("a", 40),
"b.o", Strings.repeat("b", 40),
"libc.a", Strings.repeat("c", 40),
"different", Strings.repeat("d", 40))),
pathResolver);
// Set up a map to sanitize the differences in the flags.
int pathSize = 10;
DebugPathSanitizer sanitizer1 =
new MungingDebugPathSanitizer(
pathSize,
File.separatorChar,
Paths.get("PWD"),
ImmutableBiMap.of(Paths.get("something"), Paths.get("A")));
DebugPathSanitizer sanitizer2 =
new MungingDebugPathSanitizer(
pathSize,
File.separatorChar,
Paths.get("PWD"),
ImmutableBiMap.of(Paths.get("different"), Paths.get("A")));
// Generate a rule with a path we need to sanitize to a consistent value.
ImmutableList<Arg> args1 =
ImmutableList.of(
new SanitizedArg(
sanitizer1.sanitize(Optional.empty()),
"-Lsomething/foo"));
RuleKey ruleKey1 = ruleKeyBuilderFactory.build(
new CxxLink(
params,
pathResolver,
DEFAULT_LINKER,
DEFAULT_OUTPUT,
args1,
Optional.empty(),
/* cacheable */ true));
// Generate another rule with a different path we need to sanitize to the
// same consistent value as above.
ImmutableList<Arg> args2 =
ImmutableList.of(
new SanitizedArg(
sanitizer2.sanitize(Optional.empty()),
"-Ldifferent/foo"));
RuleKey ruleKey2 = ruleKeyBuilderFactory.build(
new CxxLink(
params,
pathResolver,
DEFAULT_LINKER,
DEFAULT_OUTPUT,
args2,
Optional.empty(),
/* cacheable */ true));
assertEquals(ruleKey1, ruleKey2);
}
}
| apache-2.0 |
fengshao0907/joda-collect | src/main/java/org/joda/collect/grid/SparseGrid.java | 5643 | /*
* Copyright 2001-2014 Stephen Colebourne
*
* 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.joda.collect.grid;
import java.io.Serializable;
import java.util.Collection;
import java.util.Iterator;
import java.util.Set;
import java.util.SortedSet;
import java.util.TreeSet;
import com.google.common.collect.ForwardingSortedSet;
/**
* Mutable implementation of the {@code Grid} data structure based on hashing.
*
* @param <V> the type of the value
* @author Stephen Colebourne
*/
public final class SparseGrid<V> extends AbstractGrid<V> implements Serializable {
/** Serialization version. */
private static final long serialVersionUID = 1L;
/**
* The row count.
*/
private final int rowCount;
/**
* The column count.
*/
private final int columnCount;
/**
* The cells.
*/
private final SortedSet<Cell<V>> cells;
//-----------------------------------------------------------------------
/**
* Creates an empty {@code SparseGrid} of the specified row-column count.
*
* @param <R> the type of the value
* @param rowCount the number of rows, zero or greater
* @param columnCount the number of columns, zero or greater
* @return the mutable grid, not null
*/
public static <R> SparseGrid<R> create(int rowCount, int columnCount) {
return new SparseGrid<R>(rowCount, columnCount, new TreeSet<Cell<R>>(AbstractCell.<R>comparator()));
}
/**
* Creates a {@code SparseGrid} copying from another grid.
*
* @param <R> the type of the value
* @param grid the grid to copy, not null
* @return the mutable grid, not null
*/
public static <R> SparseGrid<R> create(Grid<? extends R> grid) {
if (grid == null) {
throw new IllegalArgumentException("Grid must not be null");
}
SparseGrid<R> created = SparseGrid.create(grid.rowCount(), grid.columnCount());
created.putAll(grid);
return created;
}
//-----------------------------------------------------------------------
/**
* Restricted constructor.
*/
SparseGrid(int rowCount, int columnCount, SortedSet<Cell<V>> data) {
validateCounts(rowCount, columnCount);
this.rowCount = rowCount;
this.columnCount = columnCount;
this.cells = data;
}
//-----------------------------------------------------------------------
@Override
public int rowCount() {
return rowCount;
}
@Override
public int columnCount() {
return columnCount;
}
//-----------------------------------------------------------------------
@Override
public int size() {
return cells.size();
}
@Override
public Cell<V> cell(int row, int column) {
if (exists(row, column)) {
SortedSet<Cell<V>> tail = cells.tailSet(finder(row, column));
if (tail.size() > 0) {
Cell<V> cell = tail.first();
if (cell.getRow() == row && cell.getColumn() == column) {
return cell;
}
}
}
return null;
}
//-----------------------------------------------------------------------
@Override
public SortedSet<Cell<V>> cells() {
return new ForwardingSortedSet<Cell<V>>() {
@Override
protected SortedSet<Cell<V>> delegate() {
return cells;
}
@Override
public boolean add(Cell<V> element) {
return super.add(ImmutableCell.copyOf(element));
}
@Override
public boolean addAll(Collection<? extends Cell<V>> collection) {
return super.standardAddAll(collection);
}
};
}
//-----------------------------------------------------------------------
@Override
public void clear() {
cells.clear();
}
@Override
public void put(int row, int column, V value) {
if (exists(row, column) == false) {
throw new IndexOutOfBoundsException("Invalid row-column: " + row + "," + column);
}
Cell<V> cell = ImmutableCell.of(row, column, value);
cells.remove(cell);
cells.add(cell);
}
@Override
public void putAll(Grid<? extends V> grid) {
if (grid == null) {
throw new IllegalArgumentException("Grid must nor be null");
}
for (Cell<? extends V> cell : grid.cells()) {
cells.add(ImmutableCell.copyOf(cell));
}
}
@Override
public boolean remove(int row, int column) {
if (exists(row, column)) {
Set<Cell<V>> tail = cells.tailSet(finder(row, column));
if (tail.size() > 0) {
Iterator<Cell<V>> it = tail.iterator();
Cell<V> cell = it.next();
if (cell.getRow() == row && cell.getColumn() == column) {
it.remove();
return true;
}
}
}
return false;
}
}
| apache-2.0 |
Achal-Aggarwal/twu-biblioteca-achal | src/com/twu/biblioteca/QuitMenuView.java | 223 | package com.twu.biblioteca;
public class QuitMenuView extends View {
public QuitMenuView(InputOutputManger inputOutputManger) {
super(inputOutputManger);
}
@Override
public void render() {
}
}
| apache-2.0 |
TimKap/tkapkaev | chapter_004/src/main/java/ru/job4j/testtask/orderbook/package-info.java | 205 | /**
* Пакет содержит классы биржевого стакана.
* @author Timur Kapkaev (timur.kap@yandex.ru)
* @version
* @since 23.07.2017
* */
package ru.job4j.testtask.orderbook; | apache-2.0 |
TomGrill/gdx-firebase | android/src/de/tomgrill/gdxfirebase/android/auth/AndroidFirebaseAuth.java | 7284 | package de.tomgrill.gdxfirebase.android.auth;
import android.app.Activity;
import android.content.Intent;
import android.support.annotation.NonNull;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.android.AndroidApplication;
import com.badlogic.gdx.backends.android.AndroidEventListener;
import com.badlogic.gdx.backends.android.AndroidFragmentApplication;
import com.badlogic.gdx.utils.Array;
import com.google.android.gms.auth.api.Auth;
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
import com.google.android.gms.auth.api.signin.GoogleSignInResult;
import com.google.android.gms.common.api.GoogleApiClient;
import com.google.firebase.auth.GoogleAuthProvider;
import de.tomgrill.gdxfirebase.core.FirebaseConfiguration;
import de.tomgrill.gdxfirebase.core.auth.*;
public class AndroidFirebaseAuth implements FirebaseAuth, AndroidEventListener {
private final static int REQUEST_CODE_SIGN_IN_WITH_GOOGLE = 33113309;
private final static int REQUEST_CODE_LINK_WITH_GOOGLE = 33113310;
private final FirebaseConfiguration firebaseConfiguration;
private final Activity activity;
private com.google.firebase.auth.FirebaseAuth firebaseAuth;
private GoogleApiClient mGoogleApiClient;
private Array<com.google.firebase.auth.FirebaseAuth.AuthStateListener> fbAuthStateListeners;
private Array<AuthStateListener> authStateListeners;
private de.tomgrill.gdxfirebase.core.auth.OnCompleteListener<AuthResult> onCompleteListener;
private boolean signInProcessRunning;
public AndroidFirebaseAuth(Activity activity, FirebaseConfiguration firebaseConfiguration) {
this.firebaseConfiguration = firebaseConfiguration;
this.activity = activity;
this.firebaseAuth = com.google.firebase.auth.FirebaseAuth.getInstance();
fbAuthStateListeners = new Array<>();
authStateListeners = new Array<>();
if (Gdx.app instanceof AndroidApplication) {
((AndroidApplication) Gdx.app).addAndroidEventListener(this);
} else if (Gdx.app instanceof AndroidFragmentApplication) {
((AndroidFragmentApplication) Gdx.app).addAndroidEventListener(this);
}
}
@Override
public FirebaseUser getCurrentUser() {
if (firebaseAuth.getCurrentUser() == null) {
return null;
}
return new AndroidFirebaseUser(firebaseAuth.getCurrentUser());
}
@Override
public void addAuthStateListener(final AuthStateListener authStateListener) {
com.google.firebase.auth.FirebaseAuth.AuthStateListener fbListener = new com.google.firebase.auth.FirebaseAuth.AuthStateListener() {
@Override
public void onAuthStateChanged(@NonNull com.google.firebase.auth.FirebaseAuth firebaseAuth) {
authStateListener.onAuthStateChanged(AndroidFirebaseAuth.this);
}
};
firebaseAuth.addAuthStateListener(fbListener);
fbAuthStateListeners.add(fbListener);
authStateListeners.add(authStateListener);
}
@Override
public void removeAuthStateListener(AuthStateListener authStateListener) {
int index = authStateListeners.indexOf(authStateListener, true);
if (index == -1) {
throw new RuntimeException("Unknown AuthStateListener. Already removed or not added.");
}
firebaseAuth.removeAuthStateListener(fbAuthStateListeners.get(index));
fbAuthStateListeners.removeIndex(index);
authStateListeners.removeIndex(index);
}
@Override
public void signInWithCredential(AuthCredential authCredential) {
firebaseAuth.signInWithCredential(((AndroidAuthCredential) authCredential).getFirebaseAuthCredential());
}
@Override
public void signInWithCustomToken(String token) {
firebaseAuth.signInWithCustomToken(token);
}
@Override
public void signInWithEmailAndPassword(String email, String password) {
firebaseAuth.signInWithEmailAndPassword(email, password);
}
@Override
public void signInAnonymously() {
firebaseAuth.signInAnonymously();
}
@Override
public void signInAnonymously(final OnCompleteListener<AuthResult> onCompleteListener) {
firebaseAuth.signInAnonymously().addOnCompleteListener(new com.google.android.gms.tasks.OnCompleteListener<com.google.firebase.auth.AuthResult>() {
@Override
public void onComplete(@NonNull com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> task) {
onCompleteListener.onComplete(new AndroidTask<AuthResult>(task));
}
});
}
@Override
public void createUserWithEmailAndPassword(String email, String password) {
firebaseAuth.createUserWithEmailAndPassword(email, password);
}
@Override
public void fetchProvidersForEmail(String email) {
// TODO
}
@Override
public void sendPasswordResetEmail(String email) {
firebaseAuth.sendPasswordResetEmail(email);
}
@Override
public void signOut() {
firebaseAuth.signOut();
}
@Override
public AuthProvider FacebookAuthProvider(String accessToken) {
return new AndroidFacebookAuthProvider(accessToken);
}
@Override
public AuthProvider GoogleAuthProvider(String accessToken) {
return new AndroidGoogleAuthProvider(accessToken);
}
// @Override
// public void linkWithGoogle(final String tokenId, final OnCompleteListener<AuthResult> onCompleteListener) {
// if(onCompleteListener == null) return;
//
// com.google.firebase.auth.AuthCredential credential = GoogleAuthProvider.getCredential(tokenId, null);
// com.google.firebase.auth.FirebaseUser firebaseUser = firebaseAuth.getCurrentUser();
// if (firebaseUser != null) {
// firebaseUser.linkWithCredential(credential).addOnCompleteListener(new com.google.android.gms.tasks.OnCompleteListener<com.google.firebase.auth.AuthResult>() {
// @Override
// public void onComplete(@NonNull com.google.android.gms.tasks.Task<com.google.firebase.auth.AuthResult> task) {
//
// signInProcessRunning = false;
// if (task.isSuccessful()) {
// Gdx.app.debug("gdx-firebase", "Linked in with Google successfully");
// onCompleteListener.onComplete(new AndroidTask<AuthResult>(task));
// } else {
// Gdx.app.debug("gdx-firebase", "Link in with Google FAILED: " + task.getException().toString());
// onCompleteListener.onComplete(new AndroidTask<AuthResult>(task));
// }
// }
// });
// } else {
// Gdx.app.debug("gdx-firebase", "Link with Google failed: Current user is NULL, cannot link.");
// signInProcessRunning = false;
// onCompleteListener.onComplete(new AndroidTask<AuthResult>(true, false, new GdxFirebaseException("Current user is NULL, cannot link.")));
// }
// }
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
}
}
| apache-2.0 |
tfisher1226/ARIES | bookshop2/bookshop2-client/src/main/java/bookshop2/client/paymentService/PaymentServiceProxyForRMI.java | 650 | package bookshop2.client.paymentService;
import org.aries.bean.Proxy;
import org.aries.tx.service.rmi.RMIProxy;
public class PaymentServiceProxyForRMI extends RMIProxy implements Proxy<PaymentService> {
private PaymentServiceInterceptor paymentServiceInterceptor;
public PaymentServiceProxyForRMI(String serviceId, String host, int port) {
super(serviceId, host, port);
createDelegate();
}
protected void createDelegate() {
paymentServiceInterceptor = new PaymentServiceInterceptor();
paymentServiceInterceptor.setProxy(this);
}
@Override
public PaymentService getDelegate() {
return paymentServiceInterceptor;
}
}
| apache-2.0 |
vamshikk/javapractice | LeetCode/AddTwoNumbers/src/com/addtwonumbers/node/ListNode.java | 194 | package com.addtwonumbers.node;
/* Definition for singly-linked list. */
public class ListNode {
public int val;
public ListNode next;
public ListNode(int x) {
val = x;
}
}
| apache-2.0 |
hazelcast/spring-data-hazelcast | src/test/java/test/utils/repository/custom/MyTitleRepositoryFactoryBean.java | 2629 | /*
* Copyright (c) 2008-2018, Hazelcast, Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package test.utils.repository.custom;
import com.hazelcast.core.HazelcastInstance;
import org.springframework.data.hazelcast.repository.support.HazelcastRepositoryFactoryBean;
import org.springframework.data.keyvalue.core.KeyValueOperations;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.RepositoryQuery;
import org.springframework.data.repository.query.parser.AbstractQueryCreator;
import javax.annotation.Resource;
import java.io.Serializable;
/**
* <P>Factory bean for creating instances of {@link MyTitleRepository},
* being {@link MovieRepository} and {@link SongRepository}.
* </P>
*
* @param <T> Repository type
* @param <S> Domain object type
* @param <ID> Key of domain object type
* @author Neil Stevenson
*/
public class MyTitleRepositoryFactoryBean<T extends Repository<S, ID>, S, ID extends Serializable>
extends HazelcastRepositoryFactoryBean<T, S, ID> {
@Resource
private HazelcastInstance hazelcastInstance;
/*
* Creates a new {@link MyTitleRepositoryFactoryBean} for the given repository interface.
*/
public MyTitleRepositoryFactoryBean(Class<? extends T> repositoryInterface) {
super(repositoryInterface);
}
/* Create a specialised repository factory.
*
* (non-Javadoc)
* @see org.springframework.data.hazelcast.repository.support.HazelcastRepositoryFactoryBean#createRepositoryFactory(org
* .springframework.data.keyvalue.core.KeyValueOperations, java.lang.Class, java.lang.Class)
*/
@Override
protected MyTitleRepositoryFactory createRepositoryFactory(KeyValueOperations operations,
Class<? extends AbstractQueryCreator<?, ?>> queryCreator,
Class<? extends RepositoryQuery> repositoryQueryType) {
return new MyTitleRepositoryFactory(operations, queryCreator, hazelcastInstance);
}
}
| apache-2.0 |
bhecquet/seleniumRobot | core/src/main/java/com/seleniumtests/uipage/htmlelements/select/ISelectList.java | 1109 | package com.seleniumtests.uipage.htmlelements.select;
import java.util.List;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
public interface ISelectList {
public void setDriver(WebDriver driver);
public boolean isApplicable();
public List<WebElement> getOptions();
public void finalizeAction();
public String getOptionValue(WebElement option);
public String getOptionText(WebElement option);
/**
* @return All selected options belonging to this select tag
*/
public List<WebElement> getAllSelectedOptions();
public void deselectByIndex(final Integer index);
public void deselectByText(final String text);
public void deselectByValue(final String value);
public void selectByIndex(int index);
public void selectByText(String text);
public void selectByValue(String value);
public void setSelected(WebElement option);
public void setDeselected(WebElement option);
public boolean isMultipleWithoutFind();
}
| apache-2.0 |
Manmay/JSefa | standard/src/test/java/org/jsefa/test/csv/EndOfLineTest.java | 7588 | /*
* Copyright 2007 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jsefa.test.csv;
import java.io.StringReader;
import junit.framework.TestCase;
import org.jsefa.csv.lowlevel.CsvLowLevelDeserializer;
import org.jsefa.csv.lowlevel.CsvLowLevelIOFactory;
import org.jsefa.csv.lowlevel.config.CsvLowLevelConfiguration;
import org.jsefa.csv.lowlevel.config.QuoteMode;
/**
* Tests to test the CSV deserialization with respect to correct handling at the end of a line.
*
* @author Norman Lahme-Huetig
*
*/
public class EndOfLineTest extends TestCase {
/**
* Test one line with mode "no delimiter after last field" for the case the last field is not empty.
*/
public void testOneLineNoEmptyLastFieldWithoutDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;b", false);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
deserializer.close(true);
}
/**
* Test two lines with mode "no delimiter after last field" for the case the last field is not empty.
*/
public void testTwoLinesNoEmptyLastFieldWithoutDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;b\na;b", false);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertFalse(deserializer.readNextRecord());
deserializer.close(true);
}
/**
* Test one line with mode "no delimiter after last field" for the case the last field is empty.
*/
public void testOneLineEmptyLastFieldWithoutDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;", false);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
deserializer.close(true);
}
/**
* Test two lines with mode "no delimiter after last field" for the case the last field is empty.
*/
public void testTwoLinesEmptyLastFieldWithoutDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;\na;", false);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertFalse(deserializer.readNextRecord());
deserializer.close(true);
}
/**
* Test one line with mode "delimiter after last field" for the case the last field is not empty.
*/
public void testOneLineNoEmptyLastFieldWithDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;b;", true);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertFalse(deserializer.readNextRecord());
deserializer.close(true);
}
/**
* Test two lines with mode "delimiter after last field" for the case the last field is not empty.
*/
public void testTwoLinesNoEmptyLastFieldWithDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;b;\na;b;", true);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertFalse(deserializer.readNextRecord());
deserializer.close(true);
}
/**
* Test one line with mode "delimiter after last field" for the case the last field is empty.
*/
public void testOneLineEmptyLastFieldWithDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;b;;", true);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertEquals("", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertFalse(deserializer.readNextRecord());
deserializer.close(true);
}
/**
* Test two lines with mode "delimiter after last field" for the case the last field is empty.
*/
public void testTwoLinesEmptyLastFieldWithDelimiter() {
CsvLowLevelDeserializer deserializer = createAndOpenDeserializer("a;b;;\na;b;;", true);
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertEquals("", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertTrue(deserializer.readNextRecord());
assertEquals("a", deserializer.nextField(QuoteMode.NEVER));
assertEquals("b", deserializer.nextField(QuoteMode.NEVER));
assertEquals("", deserializer.nextField(QuoteMode.NEVER));
assertNull(deserializer.nextField(QuoteMode.NEVER));
assertFalse(deserializer.readNextRecord());
deserializer.close(true);
}
private CsvLowLevelDeserializer createAndOpenDeserializer(String input, boolean useDelimiterAfterLastField) {
CsvLowLevelConfiguration config = new CsvLowLevelConfiguration();
config.setUseDelimiterAfterLastField(useDelimiterAfterLastField);
CsvLowLevelDeserializer deserializer = CsvLowLevelIOFactory.createFactory(config).createDeserializer();
deserializer.open(new StringReader(input));
return deserializer;
}
}
| apache-2.0 |
google/google-authenticator-android | java/com/google/android/apps/authenticator/barcode/BarcodeConditionChecker.java | 2440 | /*
* Copyright 2019 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.
*/
package com.google.android.apps.authenticator.barcode;
import android.app.Activity;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.pm.PackageManager;
import com.google.android.apps.authenticator.AuthenticatorApplication;
import com.google.android.gms.common.GoogleApiAvailability;
/**
* A class contains functions for checking conditions before running the barcode scanner.
*/
public class BarcodeConditionChecker {
/**
* Verifies that Google Play services is installed and enabled on this device, and that the
* version installed on this device is no older than the one required by this client.
*/
public boolean isGooglePlayServicesAvailable(Activity activity) {
return GoogleApiAvailability.getInstance()
.getApkVersion(activity.getApplicationContext()) >= 9200000;
}
/**
* Returns whether the barcode detector is operational or not.
*/
public boolean getIsBarcodeDetectorOperational(Activity activity) {
final AuthenticatorApplication application =
(AuthenticatorApplication) activity.getApplicationContext();
return application.getBarcodeDetector() != null
&& application.getBarcodeDetector().isOperational();
}
/**
* Check if the device has low storage.
*/
public boolean isLowStorage(Activity activity) {
IntentFilter lowStorageFilter = new IntentFilter(Intent.ACTION_DEVICE_STORAGE_LOW);
return activity.registerReceiver(null, lowStorageFilter) != null;
}
/**
* Check if the device has any front or rear camera for the barcode scanner.
*/
public boolean isCameraAvailableOnDevice(Activity activity) {
return activity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)
|| activity.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA_FRONT);
}
}
| apache-2.0 |
vam-google/google-cloud-java | google-api-grpc/proto-google-cloud-bigquerydatatransfer-v1/src/main/java/com/google/cloud/bigquery/datatransfer/v1/GetTransferConfigRequest.java | 20944 | // Generated by the protocol buffer compiler. DO NOT EDIT!
// source: google/cloud/bigquery/datatransfer/v1/datatransfer.proto
package com.google.cloud.bigquery.datatransfer.v1;
/**
*
*
* <pre>
* A request to get data transfer information.
* </pre>
*
* Protobuf type {@code google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest}
*/
public final class GetTransferConfigRequest extends com.google.protobuf.GeneratedMessageV3
implements
// @@protoc_insertion_point(message_implements:google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest)
GetTransferConfigRequestOrBuilder {
private static final long serialVersionUID = 0L;
// Use GetTransferConfigRequest.newBuilder() to construct.
private GetTransferConfigRequest(com.google.protobuf.GeneratedMessageV3.Builder<?> builder) {
super(builder);
}
private GetTransferConfigRequest() {
name_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet getUnknownFields() {
return this.unknownFields;
}
private GetTransferConfigRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
if (extensionRegistry == null) {
throw new java.lang.NullPointerException();
}
int mutable_bitField0_ = 0;
com.google.protobuf.UnknownFieldSet.Builder unknownFields =
com.google.protobuf.UnknownFieldSet.newBuilder();
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
case 10:
{
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
default:
{
if (!parseUnknownFieldProto3(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.bigquery.datatransfer.v1.DataTransferProto
.internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.datatransfer.v1.DataTransferProto
.internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.class,
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
@java.lang.Override
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
@java.lang.Override
public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_);
}
unknownFields.writeTo(output);
}
@java.lang.Override
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_);
}
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.bigquery.datatransfer.v1.GetTransferConfigRequest)) {
return super.equals(obj);
}
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest other =
(com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest) obj;
boolean result = true;
result = result && getName().equals(other.getName());
result = result && unknownFields.equals(other.unknownFields);
return result;
}
@java.lang.Override
public int hashCode() {
if (memoizedHashCode != 0) {
return memoizedHashCode;
}
int hash = 41;
hash = (19 * hash) + getDescriptor().hashCode();
hash = (37 * hash) + NAME_FIELD_NUMBER;
hash = (53 * hash) + getName().hashCode();
hash = (29 * hash) + unknownFields.hashCode();
memoizedHashCode = hash;
return hash;
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest parseFrom(
java.nio.ByteBuffer data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest 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.bigquery.datatransfer.v1.GetTransferConfigRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest 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.bigquery.datatransfer.v1.GetTransferConfigRequest parseFrom(
byte[] data) throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest parseFrom(
byte[] data, com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest parseFrom(
java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest 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.bigquery.datatransfer.v1.GetTransferConfigRequest
parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseDelimitedWithIOException(PARSER, input);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
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.bigquery.datatransfer.v1.GetTransferConfigRequest parseFrom(
com.google.protobuf.CodedInputStream input) throws java.io.IOException {
return com.google.protobuf.GeneratedMessageV3.parseWithIOException(PARSER, input);
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest 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.bigquery.datatransfer.v1.GetTransferConfigRequest 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>
* A request to get data transfer information.
* </pre>
*
* Protobuf type {@code google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest}
*/
public static final class Builder extends com.google.protobuf.GeneratedMessageV3.Builder<Builder>
implements
// @@protoc_insertion_point(builder_implements:google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest)
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor getDescriptor() {
return com.google.cloud.bigquery.datatransfer.v1.DataTransferProto
.internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_descriptor;
}
@java.lang.Override
protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable
internalGetFieldAccessorTable() {
return com.google.cloud.bigquery.datatransfer.v1.DataTransferProto
.internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.class,
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.Builder.class);
}
// Construct using
// com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(com.google.protobuf.GeneratedMessageV3.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessageV3.alwaysUseFieldBuilders) {}
}
@java.lang.Override
public Builder clear() {
super.clear();
name_ = "";
return this;
}
@java.lang.Override
public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() {
return com.google.cloud.bigquery.datatransfer.v1.DataTransferProto
.internal_static_google_cloud_bigquery_datatransfer_v1_GetTransferConfigRequest_descriptor;
}
@java.lang.Override
public com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
getDefaultInstanceForType() {
return com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
.getDefaultInstance();
}
@java.lang.Override
public com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest build() {
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
@java.lang.Override
public com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest buildPartial() {
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest result =
new com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest(this);
result.name_ = name_;
onBuilt();
return result;
}
@java.lang.Override
public Builder clone() {
return (Builder) super.clone();
}
@java.lang.Override
public Builder setField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return (Builder) super.setField(field, value);
}
@java.lang.Override
public Builder clearField(com.google.protobuf.Descriptors.FieldDescriptor field) {
return (Builder) super.clearField(field);
}
@java.lang.Override
public Builder clearOneof(com.google.protobuf.Descriptors.OneofDescriptor oneof) {
return (Builder) super.clearOneof(oneof);
}
@java.lang.Override
public Builder setRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, int index, java.lang.Object value) {
return (Builder) super.setRepeatedField(field, index, value);
}
@java.lang.Override
public Builder addRepeatedField(
com.google.protobuf.Descriptors.FieldDescriptor field, java.lang.Object value) {
return (Builder) super.addRepeatedField(field, value);
}
@java.lang.Override
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest) {
return mergeFrom(
(com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest) other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest other) {
if (other
== com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
this.mergeUnknownFields(other.unknownFields);
onChanged();
return this;
}
@java.lang.Override
public final boolean isInitialized() {
return true;
}
@java.lang.Override
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage =
(com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest)
e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public com.google.protobuf.ByteString getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8((java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public Builder setName(java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
*
*
* <pre>
* The field will contain name of the resource requested, for example:
* `projects/{project_id}/transferConfigs/{config_id}`
* </pre>
*
* <code>string name = 1;</code>
*/
public Builder setNameBytes(com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
@java.lang.Override
public final Builder setUnknownFields(final com.google.protobuf.UnknownFieldSet unknownFields) {
return super.setUnknownFieldsProto3(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.bigquery.datatransfer.v1.GetTransferConfigRequest)
}
// @@protoc_insertion_point(class_scope:google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest)
private static final com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest();
}
public static com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<GetTransferConfigRequest> PARSER =
new com.google.protobuf.AbstractParser<GetTransferConfigRequest>() {
@java.lang.Override
public GetTransferConfigRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new GetTransferConfigRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<GetTransferConfigRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<GetTransferConfigRequest> getParserForType() {
return PARSER;
}
@java.lang.Override
public com.google.cloud.bigquery.datatransfer.v1.GetTransferConfigRequest
getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}
| apache-2.0 |
oleksiyp/Aeron | aeron-driver/src/main/java/io/aeron/driver/exceptions/ControlProtocolException.java | 1126 | /*
* Copyright 2014-2017 Real Logic 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 io.aeron.driver.exceptions;
import io.aeron.ErrorCode;
public class ControlProtocolException extends IllegalArgumentException
{
private final ErrorCode code;
public ControlProtocolException(final ErrorCode code, final String msg)
{
super(msg);
this.code = code;
}
public ControlProtocolException(final ErrorCode code, final Exception rootCause)
{
super(rootCause);
this.code = code;
}
public ErrorCode errorCode()
{
return code;
}
}
| apache-2.0 |
Zot201/OnlySilver | src/main/java/zotmc/onlysilver/item/ItemOnlyBow.java | 6343 | /*
* Copyright 2016 Zot201
*
* 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 zotmc.onlysilver.item;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.projectile.EntityArrow;
import net.minecraft.init.Enchantments;
import net.minecraft.init.Items;
import net.minecraft.init.SoundEvents;
import net.minecraft.item.ItemArrow;
import net.minecraft.item.ItemBow;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.StatList;
import net.minecraft.util.DamageSource;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.event.ForgeEventFactory;
import zotmc.onlysilver.config.Config;
import zotmc.onlysilver.data.LangData;
import zotmc.onlysilver.data.ModData.OnlySilvers;
import zotmc.onlysilver.util.Utils;
import java.util.List;
public class ItemOnlyBow extends ItemBow {
public static final String ARROW_FX = OnlySilvers.MODID + "-arrowFx";
private final ToolMaterial material;
public ItemOnlyBow(ToolMaterial material) {
this.material = material;
setFull3D();
setMaxDamage(material.getMaxUses() * 2 + 1);
// See ItemBow constructor
addPropertyOverride(new ResourceLocation("pull"), (stack, __, entity) -> {
if (entity != null) {
ItemStack active = entity.getActiveItemStack();
if (active != null && active.getItem() instanceof ItemOnlyBow) {
return (stack.getMaxItemUseDuration() - entity.getItemInUseCount()) / 20F;
}
}
return 0;
});
}
@Override public void addInformation(ItemStack stack, EntityPlayer player, List<String> list, boolean par4) {
list.add(LangData.KNOCKBACK_TOOLTIP.get());
}
@Override public void onPlayerStoppedUsing(ItemStack item, World world, EntityLivingBase player, int timeLeft) {
if (player instanceof EntityPlayer) {
onPlayerStoppedUsing(item, world, (EntityPlayer) player, timeLeft);
}
}
private ItemStack findAmmo(EntityPlayer player) {
ItemStack item = player.getHeldItem(EnumHand.OFF_HAND);
if (isArrow(item)) {
return item;
}
item = player.getHeldItem(EnumHand.MAIN_HAND);
if (isArrow(item)) {
return item;
}
for (int i = 0; i < player.inventory.getSizeInventory(); i++) {
item = player.inventory.getStackInSlot(i);
if (isArrow(item)) {
return item;
}
}
return null;
}
private void onPlayerStoppedUsing(ItemStack bow, World world, EntityPlayer player, int timeLeft) {
boolean canShoot = player.capabilities.isCreativeMode || Utils.getEnchLevel(bow, Enchantments.INFINITY) > 0;
ItemStack arrow = findAmmo(player);
canShoot |= arrow != null;
int charge = getMaxItemUseDuration(bow) - timeLeft;
charge = ForgeEventFactory.onArrowLoose(bow, world, player, charge, canShoot);
if (canShoot && charge >= 0) {
if (arrow == null) {
arrow = new ItemStack(Items.ARROW);
}
float f = getArrowVelocity(charge);
if (f >= 0.1) {
boolean infinity = player.capabilities.isCreativeMode
|| (arrow.getItem() instanceof ItemArrow && ((ItemArrow) arrow.getItem()).isInfinite(arrow, bow, player));
if (!world.isRemote) {
ItemArrow i = (ItemArrow) (arrow.getItem() instanceof ItemArrow ? arrow.getItem() : Items.ARROW);
EntityArrow entity = i.createArrow(world, arrow, player);
entity.setAim(player, player.rotationPitch, player.rotationYaw, 0.0F, f * 3.0F, 1.0F);
entity.getEntityData().setBoolean(ARROW_FX, true);
if (f == 1) {
entity.setIsCritical(true);
}
int power = Utils.getEnchLevel(bow, Enchantments.POWER);
if (power > 0) {
entity.setDamage(entity.getDamage() + power * 0.5 + 0.5);
}
entity.setKnockbackStrength(Utils.getEnchLevel(bow, Enchantments.PUNCH) + 2); // +2 for silver bow
if (Utils.getEnchLevel(bow, Enchantments.FLAME) > 0) {
entity.setFire(100);
}
bow.damageItem(1, player);
if (infinity) {
entity.pickupStatus = EntityArrow.PickupStatus.CREATIVE_ONLY;
}
world.spawnEntityInWorld(entity);
}
world.playSound(null, player.posX, player.posY, player.posZ,
SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 1,
1 / (itemRand.nextFloat() * 0.4F + 1.2F) + f * 0.5F);
if (!infinity) {
arrow.stackSize--;
if (arrow.stackSize == 0) {
player.inventory.deleteStack(arrow);
}
}
//noinspection ConstantConditions // Vanilla usage
player.addStat(StatList.getObjectUseStats(this));
}
}
}
@Override public int getItemEnchantability() {
return material.getEnchantability() / 3;
}
@Override public boolean hitEntity(ItemStack item, EntityLivingBase target, EntityLivingBase attacker) {
if (Config.current().meleeBowKnockback.get()) {
int punch = Utils.getEnchLevel(item, Enchantments.PUNCH) + 3;
double x = -MathHelper.sin(attacker.rotationYaw * Utils.PI / 180.0F) * punch * 0.5;
double z = MathHelper.cos(attacker.rotationYaw * Utils.PI / 180.0F) * punch * 0.5;
target.addVelocity(x, 0.2, z);
item.damageItem(2, attacker);
return true;
}
return false;
}
public static boolean shotBySilverBow(DamageSource source) {
if ("arrow".equals(source.damageType)) {
Entity arrow = source.getSourceOfDamage();
return arrow != null && arrow.getEntityData().getBoolean(ARROW_FX);
}
return false;
}
}
| apache-2.0 |
ys305751572/shouye | src/main/java/com/smallchill/api/function/modal/UserLastReadTime.java | 2103 | package com.smallchill.api.function.modal;
import org.beetl.sql.core.annotatoin.Table;
import com.smallchill.core.annotation.BindID;
import com.smallchill.core.base.model.BaseModel;
import javax.persistence.Column;
/**
* Generated by Blade.
* 2016-11-04 17:35:21
*/
@Table(name = "tb_user_last_read_time")
@BindID(name = "id")
@SuppressWarnings("serial")
public class UserLastReadTime extends BaseModel {
@Column(name = "id")
private Integer id;
@Column(name = "user_id")
private Integer userId;
@Column(name = "new_time")
private Long newTime = 0L;
@Column(name = "intereste")
private Long intereste = 0L;
@Column(name = "interested")
private Long interested = 0L;
@Column(name = "acquaintances")
private Long acquaintances = 0L;
@Column(name = "group")
private Long group = 0L;
@Column(name = "feekback")
private Long feekback = 0L;
public Long getFeekback() {
return feekback;
}
public void setFeekback(Long feekback) {
this.feekback = feekback;
}
public Long getGroup() {
return group;
}
public void setGroup(Long group) {
this.group = group;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Long getNewTime() {
return newTime;
}
public void setNewTime(Long newTime) {
this.newTime = newTime;
}
public Long getIntereste() {
return intereste;
}
public void setIntereste(Long intereste) {
this.intereste = intereste;
}
public Long getInterested() {
return interested;
}
public void setInterested(Long interested) {
this.interested = interested;
}
public Long getAcquaintances() {
return acquaintances;
}
public void setAcquaintances(Long acquaintances) {
this.acquaintances = acquaintances;
}
}
| apache-2.0 |
lesaint/experimenting-annotation-processing | experimenting-rounds/massive-count-of-annotated-classes/src/main/java/fr/javatronic/blog/massive/annotation1/sub1/Class_6484.java | 151 | package fr.javatronic.blog.massive.annotation1.sub1;
import fr.javatronic.blog.processor.Annotation_001;
@Annotation_001
public class Class_6484 {
}
| apache-2.0 |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/FleetLaunchTemplateConfig.java | 7429 | /*
* Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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.amazonaws.services.ec2.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
* <p>
* Describes a launch template and overrides.
* </p>
*
* @see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/FleetLaunchTemplateConfig" target="_top">AWS API
* Documentation</a>
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class FleetLaunchTemplateConfig implements Serializable, Cloneable {
/**
* <p>
* The launch template.
* </p>
*/
private FleetLaunchTemplateSpecification launchTemplateSpecification;
/**
* <p>
* Any parameters that you specify override the same parameters in the launch template.
* </p>
*/
private com.amazonaws.internal.SdkInternalList<FleetLaunchTemplateOverrides> overrides;
/**
* <p>
* The launch template.
* </p>
*
* @param launchTemplateSpecification
* The launch template.
*/
public void setLaunchTemplateSpecification(FleetLaunchTemplateSpecification launchTemplateSpecification) {
this.launchTemplateSpecification = launchTemplateSpecification;
}
/**
* <p>
* The launch template.
* </p>
*
* @return The launch template.
*/
public FleetLaunchTemplateSpecification getLaunchTemplateSpecification() {
return this.launchTemplateSpecification;
}
/**
* <p>
* The launch template.
* </p>
*
* @param launchTemplateSpecification
* The launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetLaunchTemplateConfig withLaunchTemplateSpecification(FleetLaunchTemplateSpecification launchTemplateSpecification) {
setLaunchTemplateSpecification(launchTemplateSpecification);
return this;
}
/**
* <p>
* Any parameters that you specify override the same parameters in the launch template.
* </p>
*
* @return Any parameters that you specify override the same parameters in the launch template.
*/
public java.util.List<FleetLaunchTemplateOverrides> getOverrides() {
if (overrides == null) {
overrides = new com.amazonaws.internal.SdkInternalList<FleetLaunchTemplateOverrides>();
}
return overrides;
}
/**
* <p>
* Any parameters that you specify override the same parameters in the launch template.
* </p>
*
* @param overrides
* Any parameters that you specify override the same parameters in the launch template.
*/
public void setOverrides(java.util.Collection<FleetLaunchTemplateOverrides> overrides) {
if (overrides == null) {
this.overrides = null;
return;
}
this.overrides = new com.amazonaws.internal.SdkInternalList<FleetLaunchTemplateOverrides>(overrides);
}
/**
* <p>
* Any parameters that you specify override the same parameters in the launch template.
* </p>
* <p>
* <b>NOTE:</b> This method appends the values to the existing list (if any). Use
* {@link #setOverrides(java.util.Collection)} or {@link #withOverrides(java.util.Collection)} if you want to
* override the existing values.
* </p>
*
* @param overrides
* Any parameters that you specify override the same parameters in the launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetLaunchTemplateConfig withOverrides(FleetLaunchTemplateOverrides... overrides) {
if (this.overrides == null) {
setOverrides(new com.amazonaws.internal.SdkInternalList<FleetLaunchTemplateOverrides>(overrides.length));
}
for (FleetLaunchTemplateOverrides ele : overrides) {
this.overrides.add(ele);
}
return this;
}
/**
* <p>
* Any parameters that you specify override the same parameters in the launch template.
* </p>
*
* @param overrides
* Any parameters that you specify override the same parameters in the launch template.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public FleetLaunchTemplateConfig withOverrides(java.util.Collection<FleetLaunchTemplateOverrides> overrides) {
setOverrides(overrides);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getLaunchTemplateSpecification() != null)
sb.append("LaunchTemplateSpecification: ").append(getLaunchTemplateSpecification()).append(",");
if (getOverrides() != null)
sb.append("Overrides: ").append(getOverrides());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof FleetLaunchTemplateConfig == false)
return false;
FleetLaunchTemplateConfig other = (FleetLaunchTemplateConfig) obj;
if (other.getLaunchTemplateSpecification() == null ^ this.getLaunchTemplateSpecification() == null)
return false;
if (other.getLaunchTemplateSpecification() != null && other.getLaunchTemplateSpecification().equals(this.getLaunchTemplateSpecification()) == false)
return false;
if (other.getOverrides() == null ^ this.getOverrides() == null)
return false;
if (other.getOverrides() != null && other.getOverrides().equals(this.getOverrides()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getLaunchTemplateSpecification() == null) ? 0 : getLaunchTemplateSpecification().hashCode());
hashCode = prime * hashCode + ((getOverrides() == null) ? 0 : getOverrides().hashCode());
return hashCode;
}
@Override
public FleetLaunchTemplateConfig clone() {
try {
return (FleetLaunchTemplateConfig) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}
| apache-2.0 |