repo_name
stringlengths
7
104
file_path
stringlengths
13
198
context
stringlengths
67
7.15k
import_statement
stringlengths
16
4.43k
code
stringlengths
40
6.98k
prompt
stringlengths
227
8.27k
next_line
stringlengths
8
795
mpusher/mpush-client-java
src/main/java/com/mpush/client/ConnectThread.java
// Path: src/main/java/com/mpush/util/thread/EventLock.java // public final class EventLock { // private final ReentrantLock lock; // private final Condition cond; // // public EventLock() { // lock = new ReentrantLock(); // cond = lock.newCondition(); // } // // public void lock()...
import java.util.concurrent.Callable; import com.mpush.util.thread.EventLock; import com.mpush.util.thread.ExecutorManager;
/* * (C) Copyright 2015-2016 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...
// Path: src/main/java/com/mpush/util/thread/EventLock.java // public final class EventLock { // private final ReentrantLock lock; // private final Condition cond; // // public EventLock() { // lock = new ReentrantLock(); // cond = lock.newCondition(); // } // // public void lock()...
this.setName(ExecutorManager.START_THREAD_NAME);
mpusher/mpush-client-java
src/main/java/com/mpush/api/push/PushContext.java
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
import com.mpush.api.Constants; import com.mpush.api.ack.AckContext; import com.mpush.api.ack.AckModel;
/* * (C) Copyright 2015-2016 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...
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
return new PushContext(content.getBytes(Constants.UTF_8));
mpusher/mpush-client-java
src/main/java/com/mpush/api/push/PushContext.java
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
import com.mpush.api.Constants; import com.mpush.api.ack.AckContext; import com.mpush.api.ack.AckModel;
/* * (C) Copyright 2015-2016 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...
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
public AckModel getAckModel() {
mpusher/mpush-client-java
src/main/java/com/mpush/util/crypto/Base64Utils.java
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
import java.io.*; import com.mpush.api.Constants;
/* * (C) Copyright 2015-2016 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...
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
return new String(Base64.getEncoder().encode(bytes), Constants.UTF_8);
mpusher/mpush-client-java
src/main/java/com/mpush/util/IOUtils.java
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
import com.mpush.api.Constants; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.Closeable; import java.io.IOException; import java.util.zip.DeflaterOutputStream; import java.util.zip.InflaterInputStream;
/* * (C) Copyright 2015-2016 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...
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
return Constants.EMPTY_BYTES;
mpusher/mpush-client-java
src/main/java/com/mpush/api/http/HttpRequest.java
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
import com.mpush.api.Constants; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.Charset; import java.util.HashMap; import java.util.Map; import java.util.Scanner; import static com.mpush.api.Constants.HTTP_HEAD_READ_TIMEOUT;
return uri; } public Map<String, String> getHeaders() { headers.put(HTTP_HEAD_READ_TIMEOUT, Integer.toString(timeout)); return headers; } public HttpRequest setHeaders(Map<String, String> headers) { this.getHeaders().putAll(headers); return this; } publ...
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
setPostParam(headers, Constants.UTF_8);
mpusher/mpush-client-java
src/main/java/com/mpush/api/http/HttpResponse.java
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
import java.util.Map; import com.mpush.api.Constants;
/* * (C) Copyright 2015-2016 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...
// Path: src/main/java/com/mpush/api/Constants.java // public interface Constants { // Charset UTF_8 = Charset.forName("UTF-8"); // // int DEFAULT_SO_TIMEOUT = 1000 * 3;//客户端连接超时时间 // // int DEFAULT_WRITE_TIMEOUT = 1000 * 10;//10s默认packet写超时 // // byte[] EMPTY_BYTES = new byte[0]; // // int DEF_...
", body=" + (body == null ? "" : new String(body, Constants.UTF_8)) +
azinik/ADRMine
release/v1/java_src/rnlp/src/main/java/rainbownlp/analyzer/ml/LearnerCommon.java
// Path: release/v1/java_src/rnlp/src/main/java/rainbownlp/core/Setting.java // public class Setting { // public static final String RuleSureCorpus = "RuleSure"; // public static boolean SaveInGetInstance = true; // static Properties configFile; // public enum OperationMode // { // TRIGGER, // EDGE, // ARTIF...
import java.sql.SQLException; import rainbownlp.core.Setting; import rainbownlp.core.Setting.OperationMode;
package rainbownlp.analyzer.ml; //import rainbownlp.db.entities.ArtifactTable; //import rainbownlp.db.entities.RelationExampleTable; //import rainbownlp.db.entities.ArtifactExampleTable; public class LearnerCommon { public static void includeExamples(String updateTo) throws SQLException { // if(Setting.Mode==Oper...
// Path: release/v1/java_src/rnlp/src/main/java/rainbownlp/core/Setting.java // public class Setting { // public static final String RuleSureCorpus = "RuleSure"; // public static boolean SaveInGetInstance = true; // static Properties configFile; // public enum OperationMode // { // TRIGGER, // EDGE, // ARTIF...
if (Setting.getValue("RelationMode").equals("BioNLP")) {
omacarena/only-short-poc
java.multiversion/v3/src/main/sample/multiversion/ImportantCore.java
// Path: java.multiversion/v2dep/src/main/sample/multiversion/deps/CoreDependency.java // public class CoreDependency { // // public String getVersion() { // return "core-dep-v2"; // } // }
import sample.multiversion.deps.CoreDependency;
package sample.multiversion; public class ImportantCore implements Core { private Utility utility;
// Path: java.multiversion/v2dep/src/main/sample/multiversion/deps/CoreDependency.java // public class CoreDependency { // // public String getVersion() { // return "core-dep-v2"; // } // } // Path: java.multiversion/v3/src/main/sample/multiversion/ImportantCore.java import sample.multiversion.deps.C...
private CoreDependency coreDependency;
omacarena/only-short-poc
java.multiversion/versiontest/src/main/sample/multiversion/versiontext/TestMain.java
// Path: java.multiversion/v1/src/main/sample/multiversion/Core.java // public interface Core { // // String getVersion(); // String getDependencyVersion(); // } // // Path: java.multiversion/v3/src/main/sample/multiversion/ImportantCore.java // public class ImportantCore implements Core { // // private ...
import sample.multiversion.Core; import sample.multiversion.ImportantCore; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Paths;
package sample.multiversion.versiontext; public class TestMain { public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { // multiple versions of the same l...
// Path: java.multiversion/v1/src/main/sample/multiversion/Core.java // public interface Core { // // String getVersion(); // String getDependencyVersion(); // } // // Path: java.multiversion/v3/src/main/sample/multiversion/ImportantCore.java // public class ImportantCore implements Core { // // private ...
Core coreV3Instance = new ImportantCore();
omacarena/only-short-poc
java.multiversion/versiontest/src/main/sample/multiversion/versiontext/TestMain.java
// Path: java.multiversion/v1/src/main/sample/multiversion/Core.java // public interface Core { // // String getVersion(); // String getDependencyVersion(); // } // // Path: java.multiversion/v3/src/main/sample/multiversion/ImportantCore.java // public class ImportantCore implements Core { // // private ...
import sample.multiversion.Core; import sample.multiversion.ImportantCore; import java.lang.reflect.InvocationTargetException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.nio.file.Paths;
package sample.multiversion.versiontext; public class TestMain { public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException, NoSuchMethodException, InvocationTargetException { // multiple versions of the same l...
// Path: java.multiversion/v1/src/main/sample/multiversion/Core.java // public interface Core { // // String getVersion(); // String getDependencyVersion(); // } // // Path: java.multiversion/v3/src/main/sample/multiversion/ImportantCore.java // public class ImportantCore implements Core { // // private ...
Core coreV3Instance = new ImportantCore();
omacarena/only-short-poc
java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/repositories/config/MySqlSource1Config.java
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
import my.java.spring.jpa.multi.models.Organization; import my.java.spring.jpa.multi.repositories.interfaces.OrganizationRepository; import my.java.spring.jpa.multi.repositories.source1.Source1OrganizationRepositoryImpl; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.auto...
package my.java.spring.jpa.multi.repositories.config; /** * Repository configuration. * @EnableJpaRepositories to enable JPA automatic repositories. */ @Configuration @EnableJpaRepositories(
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
basePackageClasses = { Source1OrganizationRepositoryImpl.class },
omacarena/only-short-poc
java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/repositories/config/MySqlSource1Config.java
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
import my.java.spring.jpa.multi.models.Organization; import my.java.spring.jpa.multi.repositories.interfaces.OrganizationRepository; import my.java.spring.jpa.multi.repositories.source1.Source1OrganizationRepositoryImpl; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.auto...
package my.java.spring.jpa.multi.repositories.config; /** * Repository configuration. * @EnableJpaRepositories to enable JPA automatic repositories. */ @Configuration @EnableJpaRepositories( basePackageClasses = { Source1OrganizationRepositoryImpl.class }, entityManagerFactoryRef = MySqlSource1Con...
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
omacarena/only-short-poc
java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/repositories/config/MySqlSource2Config.java
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
import my.java.spring.jpa.multi.models.Organization; import my.java.spring.jpa.multi.repositories.interfaces.OrganizationRepository; import my.java.spring.jpa.multi.repositories.source2.Source2OrganizationRepositoryImpl; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.auto...
package my.java.spring.jpa.multi.repositories.config; /** * Repository configuration. * @EnableJpaRepositories to enable JPA automatic repositories. */ @Configuration @EnableJpaRepositories(
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
basePackageClasses = { Source2OrganizationRepositoryImpl.class },
omacarena/only-short-poc
java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/repositories/config/MySqlSource2Config.java
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
import my.java.spring.jpa.multi.models.Organization; import my.java.spring.jpa.multi.repositories.interfaces.OrganizationRepository; import my.java.spring.jpa.multi.repositories.source2.Source2OrganizationRepositoryImpl; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.boot.auto...
package my.java.spring.jpa.multi.repositories.config; /** * Repository configuration. * @EnableJpaRepositories to enable JPA automatic repositories. */ @Configuration @EnableJpaRepositories( basePackageClasses = { Source2OrganizationRepositoryImpl.class }, entityManagerFactoryRef = MySqlSource2Con...
// Path: java.spring.jpa.multi/myapp/src/main/my/java/spring/jpa/multi/models/Organization.java // @Entity // @Table(name = "Organization", schema = "mytest") // public class Organization { // // @Id // @GeneratedValue(strategy = GenerationType.IDENTITY) // private Integer id; // // @Column(unique = t...
entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
omacarena/only-short-poc
java.spring.mongo/myapp/src/main/my/java/spring/mongo/myapp/controllers/MyController.java
// Path: java.spring.mongo/myapp/src/main/my/java/spring/mongo/myapp/repositories/MyMongoRepository.java // @Repository // public class MyMongoRepository { // // private final MongoTemplate mongoTemplate; // // @Autowired // public MyMongoRepository(MongoTemplate mongoTemplate) { // this.mongoTemp...
import my.java.spring.mongo.myapp.repositories.MyMongoRepository; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;
package my.java.spring.mongo.myapp.controllers; @RestController @RequestMapping("/v1/my") public class MyController {
// Path: java.spring.mongo/myapp/src/main/my/java/spring/mongo/myapp/repositories/MyMongoRepository.java // @Repository // public class MyMongoRepository { // // private final MongoTemplate mongoTemplate; // // @Autowired // public MyMongoRepository(MongoTemplate mongoTemplate) { // this.mongoTemp...
private final MyMongoRepository myMongoRepository;
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/writer/StringSetTypeWriter.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java // public class KeyAnnotatedField { // // public final VariableElement annotatedElement; // public final TypeName type; // public final String name; // public final String preferenceKey; // public final boolean ...
import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeName; import net.yslibrary.simplepreferences.processor.KeyAnnotatedField; import net.yslibrary.simplepreferences.processor.Utils; import javax.lang.model.element.Modifier;
package net.yslibrary.simplepreferences.processor.writer; /** * Created by yshrsmz on 2016/02/23. */ public class StringSetTypeWriter extends BaseTypeWriter { protected StringSetTypeWriter(TypeName enclosingClassName, KeyAnnotatedField keyAnnotatedField) { super(enclosingClassName, keyAnnotatedField); } ...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java // public class KeyAnnotatedField { // // public final VariableElement annotatedElement; // public final TypeName type; // public final String name; // public final String preferenceKey; // public final boolean ...
.methodBuilder(BaseTypeWriter.SETTER_PREFIX + Utils.lowerToUpperCamel(annotatedField.name))
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
import com.google.common.base.Strings; import com.squareup.javapoet.TypeName; import net.yslibrary.simplepreferences.annotation.Key; import net.yslibrary.simplepreferences.processor.exception.ProcessingException; import javax.lang.model.element.Modifier; import javax.lang.model.element.VariableElement;
package net.yslibrary.simplepreferences.processor; /** * Created by yshrsmz on 2016/02/21. */ public class KeyAnnotatedField { public final VariableElement annotatedElement; public final TypeName type; public final String name; public final String preferenceKey; public final boolean omitGetterPrefix; ...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
public KeyAnnotatedField(VariableElement element) throws ProcessingException {
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/SimplePreferencesProcessor.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
import com.google.auto.service.AutoService; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.TypeSpec; import net.yslibrary.simplepreferences.annotation.Preferences; import net.yslibrary.simplepreferences.processor.exception.ProcessingException; import net.yslibrary.simplepreferences.processor.writer...
elementUtils = processingEnv.getElementUtils(); typeUtils = processingEnv.getTypeUtils(); filer = processingEnv.getFiler(); messager = processingEnv.getMessager(); } @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { messager.printMessage(Dia...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
throw new ProcessingException(typeElement,
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/SimplePreferencesProcessor.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
import com.google.auto.service.AutoService; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.TypeSpec; import net.yslibrary.simplepreferences.annotation.Preferences; import net.yslibrary.simplepreferences.processor.exception.ProcessingException; import net.yslibrary.simplepreferences.processor.writer...
return; } try { TypeElement typeElement = (TypeElement) element; PreferenceAnnotatedClass model = new PreferenceAnnotatedClass(typeElement, elementUtils); checkValid(model); PreferenceAnnotatedClass existing = items.get(model.preferenceName); if (existing...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
TypeSpec clazz = (new PreferenceWriter(preferenceAnnotatedClass)).write();
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/PreferenceAnnotatedClass.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
import com.google.common.base.Strings; import net.yslibrary.simplepreferences.annotation.Key; import net.yslibrary.simplepreferences.annotation.Preferences; import net.yslibrary.simplepreferences.processor.exception.ProcessingException; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; ...
package net.yslibrary.simplepreferences.processor; /** * Created by yshrsmz on 2016/02/21. */ public class PreferenceAnnotatedClass { public final static String DEFAULT_PREFS = "net.yslibrary.simplepreferences.default_name"; private final static String SUFFIX = "Prefs"; public final TypeElement annotated...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/exception/ProcessingException.java // public class ProcessingException extends Exception { // // public final Element element; // // public ProcessingException(Element element, String message, Object... args) { // super(String.format(m...
throws IllegalStateException, ProcessingException {
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/writer/BaseTypeWriter.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java // public class KeyAnnotatedField { // // public final VariableElement annotatedElement; // public final TypeName type; // public final String name; // public final String preferenceKey; // public final boolean ...
import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeName; import net.yslibrary.simplepreferences.processor.KeyAnnotatedField; import net.yslibrary.simplepreferences.processor.Utils; import java.util.ArrayList; import java.util.List; import javax.lang.model.e...
package net.yslibrary.simplepreferences.processor.writer; /** * Created by yshrsmz on 2016/02/23. */ public abstract class BaseTypeWriter implements TypeWriter { final static String BOOLEAN_GETTER_PREFIX = "is"; final static String SETTER_PREFIX = "set"; final static String WITH_COMMIT_SUFFIX = "WithCommit...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java // public class KeyAnnotatedField { // // public final VariableElement annotatedElement; // public final TypeName type; // public final String name; // public final String preferenceKey; // public final boolean ...
final KeyAnnotatedField annotatedField;
yshrsmz/simple-preferences
processor/src/main/java/net/yslibrary/simplepreferences/processor/writer/BaseTypeWriter.java
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java // public class KeyAnnotatedField { // // public final VariableElement annotatedElement; // public final TypeName type; // public final String name; // public final String preferenceKey; // public final boolean ...
import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeName; import net.yslibrary.simplepreferences.processor.KeyAnnotatedField; import net.yslibrary.simplepreferences.processor.Utils; import java.util.ArrayList; import java.util.List; import javax.lang.model.e...
package net.yslibrary.simplepreferences.processor.writer; /** * Created by yshrsmz on 2016/02/23. */ public abstract class BaseTypeWriter implements TypeWriter { final static String BOOLEAN_GETTER_PREFIX = "is"; final static String SETTER_PREFIX = "set"; final static String WITH_COMMIT_SUFFIX = "WithCommit...
// Path: processor/src/main/java/net/yslibrary/simplepreferences/processor/KeyAnnotatedField.java // public class KeyAnnotatedField { // // public final VariableElement annotatedElement; // public final TypeName type; // public final String name; // public final String preferenceKey; // public final boolean ...
return MethodSpec.methodBuilder(EXIST_PREFIX + Utils.lowerToUpperCamel(annotatedField.name))
mojohaus/extra-enforcer-rules
src/test/java/org/apache/maven/plugins/enforcer/JarUtilsTest.java
// Path: src/test/java/org/apache/maven/plugins/enforcer/ArtifactBuilder.java // public static ArtifactBuilder newBuilder() // { // return new ArtifactBuilder(); // }
import org.apache.maven.artifact.Artifact; import org.junit.Test; import static org.apache.maven.plugins.enforcer.ArtifactBuilder.newBuilder; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue;
package org.apache.maven.plugins.enforcer; public class JarUtilsTest { /** * "Sunny day" test: the method should return true for a jar artifact. */ @Test public void isJarFileShouldReturnTrueForJarFile() {
// Path: src/test/java/org/apache/maven/plugins/enforcer/ArtifactBuilder.java // public static ArtifactBuilder newBuilder() // { // return new ArtifactBuilder(); // } // Path: src/test/java/org/apache/maven/plugins/enforcer/JarUtilsTest.java import org.apache.maven.artifact.Artifact; import org.junit.Test; import...
Artifact artifact = newBuilder().withType( "jar" ).build();
mojohaus/extra-enforcer-rules
src/main/java/org/apache/maven/plugins/enforcer/Hasher.java
// Path: src/main/java/org/apache/maven/plugins/enforcer/JarUtils.java // public static boolean isJarFile( Artifact artifact ) // { // return artifact.getFile().isFile() && "jar".equals( artifact.getType() ); // }
import java.io.Closeable; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.util.jar.JarFile; import org.apache.commons.codec.digest.DigestUtils; import org.apache.maven.artifact.Artifact; import static org.apache.maven.plugins.enforcer.JarUtils.isJ...
package org.apache.maven.plugins.enforcer; /* * 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 L...
// Path: src/main/java/org/apache/maven/plugins/enforcer/JarUtils.java // public static boolean isJarFile( Artifact artifact ) // { // return artifact.getFile().isFile() && "jar".equals( artifact.getType() ); // } // Path: src/main/java/org/apache/maven/plugins/enforcer/Hasher.java import java.io.Closeable; impor...
else if ( isJarFile( artifact ) )
mojohaus/extra-enforcer-rules
src/main/java/org/apache/maven/plugins/enforcer/BanDuplicateClasses.java
// Path: src/main/java/org/codehaus/mojo/enforcer/Dependency.java // public class Dependency // { // // private String groupId; // // private String artifactId; // // private String classifier; // // private String type; // // /** // * List of classes to ignore. Wildcard at...
import java.util.jar.JarFile; import java.util.regex.Pattern; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.codehaus.mojo.enforcer.Dependency; import org.codehaus.plexus.util.FileUtils; import static org.apache.maven.plugins.enforcer.JarUtils.isJa...
package org.apache.maven.plugins.enforcer; /* * 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 L...
// Path: src/main/java/org/codehaus/mojo/enforcer/Dependency.java // public class Dependency // { // // private String groupId; // // private String artifactId; // // private String classifier; // // private String type; // // /** // * List of classes to ignore. Wildcard at...
private List<Dependency> dependencies;
mojohaus/extra-enforcer-rules
src/main/java/org/apache/maven/plugins/enforcer/BanDuplicateClasses.java
// Path: src/main/java/org/codehaus/mojo/enforcer/Dependency.java // public class Dependency // { // // private String groupId; // // private String artifactId; // // private String classifier; // // private String type; // // /** // * List of classes to ignore. Wildcard at...
import java.util.jar.JarFile; import java.util.regex.Pattern; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.codehaus.mojo.enforcer.Dependency; import org.codehaus.plexus.util.FileUtils; import static org.apache.maven.plugins.enforcer.JarUtils.isJa...
if( scopes != null && !scopes.contains( o.getScope() ) ) { if( getLog().isDebugEnabled() ) { getLog().debug( "Skipping " + o + " due to scope" ); } continue; } File file = o.getFile(); ...
// Path: src/main/java/org/codehaus/mojo/enforcer/Dependency.java // public class Dependency // { // // private String groupId; // // private String artifactId; // // private String classifier; // // private String type; // // /** // * List of classes to ignore. Wildcard at...
else if ( isJarFile( o ) )
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/RegistryGenerator.java
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class ...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.TypeVariableName; import java.util.List; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; impo...
package pocketbus.internal.codegen; public class RegistryGenerator { private final String packageName; private final TypeElement typeElement; private List<SubscriptionNode> subscriptionTrees; public RegistryGenerator(TypeElement typeElement, String packageName) { this.typeElement = typeEle...
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class ...
TypeSpec.Builder classBuilder = TypeSpec.classBuilder(PocketBusConst.REGISTRY_NAME)
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/RegistryGenerator.java
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class ...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.TypeVariableName; import java.util.List; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; impo...
package pocketbus.internal.codegen; public class RegistryGenerator { private final String packageName; private final TypeElement typeElement; private List<SubscriptionNode> subscriptionTrees; public RegistryGenerator(TypeElement typeElement, String packageName) { this.typeElement = typeEle...
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class ...
.addSuperinterface(ClassName.get(Registry.class));
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/RegistryGenerator.java
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class ...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.TypeVariableName; import java.util.List; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; impo...
package pocketbus.internal.codegen; public class RegistryGenerator { private final String packageName; private final TypeElement typeElement; private List<SubscriptionNode> subscriptionTrees; public RegistryGenerator(TypeElement typeElement, String packageName) { this.typeElement = typeEle...
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class ...
.returns(SubscriptionRegistration.class);
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/SubscriptionProcessor.java
// Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class PocketBusConst { // public static final String ANDROID_PREFIX = "android."; // public static final String JAVA_PREFIX = "java."; // // public static final String REGISTRATION_SUFFIX = "SubscriptionRegistration"; // publi...
import com.google.common.collect.ImmutableSet; import java.util.Collections; import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.Map; import java.util.Set; import javax.annotation.processing.Messager; import javax.annotation.processing.RoundEnvironment; import javax.lang.model.element.Eleme...
Subscribe subscribeAnnotation = element.getAnnotation(Subscribe.class); if (subscribeAnnotation == null) { messager.printMessage(WARNING, String.format("@%s annotation not found on %s", Subscribe.class.getSimpleName(), element), element); continue; } ...
// Path: core/src/main/java/pocketbus/internal/PocketBusConst.java // public class PocketBusConst { // public static final String ANDROID_PREFIX = "android."; // public static final String JAVA_PREFIX = "java."; // // public static final String REGISTRATION_SUFFIX = "SubscriptionRegistration"; // publi...
entry.getValue().setParentAdapter(getPackageName(parentElement), parentElement.getSimpleName() + PocketBusConst.REGISTRATION_SUFFIX);
hansenji/PocketBus
library/src/main/java/pocketbus/Bus.java
// Path: core/src/main/java/pocketbus/internal/Registry.java // public interface Registry { // /** // * @param target the target that has subscribe annotations // * @return the SubscriptionRegistration for the given target // */ // <T> SubscriptionRegistration getRegistration(T target); // }
import android.support.annotation.NonNull; import android.support.annotation.Nullable; import android.util.Log; import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util....
package pocketbus; public class Bus { private static final String TAG = "PocketBus"; private static final Object DEFAULT_LOCK = new Object(); private static Bus defaultBus; private static boolean debug = false; @NonNull private final Scheduler mainScheduler; @NonNull private final ...
// Path: core/src/main/java/pocketbus/internal/Registry.java // public interface Registry { // /** // * @param target the target that has subscribe annotations // * @return the SubscriptionRegistration for the given target // */ // <T> SubscriptionRegistration getRegistration(T target); // } //...
private Registry registry = null;
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/SubscriptionGenerator.java
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/Subscription.java // public interface Subscri...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.W...
package pocketbus.internal.codegen; public class SubscriptionGenerator { private static final ParameterizedTypeName SUBSCRIPTION_TYPE = ParameterizedTypeName.get(ClassName.get(Subscription.class), WildcardTypeName.subtypeOf(TypeName.OBJECT)); private static final ParameterizedTypeName LIST_TYP...
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/Subscription.java // public interface Subscri...
.addField(getWeakReferenceType(), PocketBusConst.VAR_TARGET_REF, Modifier.PRIVATE, Modifier.FINAL)
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/SubscriptionGenerator.java
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/Subscription.java // public interface Subscri...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.W...
package pocketbus.internal.codegen; public class SubscriptionGenerator { private static final ParameterizedTypeName SUBSCRIPTION_TYPE = ParameterizedTypeName.get(ClassName.get(Subscription.class), WildcardTypeName.subtypeOf(TypeName.OBJECT)); private static final ParameterizedTypeName LIST_TYP...
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/Subscription.java // public interface Subscri...
classBuilder.addSuperinterface(ClassName.get(SubscriptionRegistration.class));
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/SubscriptionGenerator.java
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/Subscription.java // public interface Subscri...
import com.squareup.javapoet.ClassName; import com.squareup.javapoet.FieldSpec; import com.squareup.javapoet.JavaFile; import com.squareup.javapoet.MethodSpec; import com.squareup.javapoet.ParameterizedTypeName; import com.squareup.javapoet.TypeName; import com.squareup.javapoet.TypeSpec; import com.squareup.javapoet.W...
private void generateHandleMethod(TypeSpec.Builder classBuilder, SubscriptionMethod subscriptionMethod) { MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(PocketBusConst.METHOD_HANDLE) .addModifiers(Modifier.PUBLIC) .addAnnotation(Override.class) .a...
// Path: core/src/main/java/pocketbus/SubscriptionRegistration.java // public interface SubscriptionRegistration { // /** // * @return a list of subscriptions // */ // List<Subscription<?>> getSubscriptions(); // } // // Path: core/src/main/java/pocketbus/Subscription.java // public interface Subscri...
.returns(TypeName.get(ThreadMode.class))
hansenji/PocketBus
compiler/src/main/java/pocketbus/internal/codegen/SubscriptionMethod.java
// Path: core/src/main/java/pocketbus/ThreadMode.java // public enum ThreadMode { // /** // * Subscription run on same thread as caller // */ // CURRENT, // Schedulers.trampoline() // /** // * Subscription run on the main thread // */ // MAIN, // AndroidSchedulers.mainThread() // ...
import javax.lang.model.element.ExecutableElement; import javax.lang.model.type.TypeMirror; import pocketbus.ThreadMode;
package pocketbus.internal.codegen; public class SubscriptionMethod { private final TypeMirror eventType; private final String name;
// Path: core/src/main/java/pocketbus/ThreadMode.java // public enum ThreadMode { // /** // * Subscription run on same thread as caller // */ // CURRENT, // Schedulers.trampoline() // /** // * Subscription run on the main thread // */ // MAIN, // AndroidSchedulers.mainThread() // ...
private final ThreadMode threadMode;
CreateChance/DoorGod
app/src/main/java/com/createchance/doorgod/fingerprint/MyAuthCallback.java
// Path: app/src/main/java/com/createchance/doorgod/util/FingerprintAuthResponse.java // public class FingerprintAuthResponse { // public static final int MSG_AUTH_SUCCESS = 100; // public static final int MSG_AUTH_FAILED = 101; // public static final int MSG_AUTH_ERROR = 102; // public static final int...
import android.support.v4.hardware.fingerprint.FingerprintManagerCompat; import com.createchance.doorgod.util.FingerprintAuthResponse; import org.greenrobot.eventbus.EventBus;
package com.createchance.doorgod.fingerprint; /** * Fingerprint auth result callback. */ public class MyAuthCallback extends FingerprintManagerCompat.AuthenticationCallback { public MyAuthCallback() { super(); } @Override public void onAuthenticationError(int errMsgId, CharSequence errSt...
// Path: app/src/main/java/com/createchance/doorgod/util/FingerprintAuthResponse.java // public class FingerprintAuthResponse { // public static final int MSG_AUTH_SUCCESS = 100; // public static final int MSG_AUTH_FAILED = 101; // public static final int MSG_AUTH_ERROR = 102; // public static final int...
post(new FingerprintAuthResponse(FingerprintAuthResponse.MSG_AUTH_ERROR));
CreateChance/DoorGod
app/src/main/java/com/createchance/doorgod/ui/IntrusionRecordDetailsActivity.java
// Path: app/src/main/java/com/createchance/doorgod/adapter/IntrusionRecordDetailsAdapter.java // public class IntrusionRecordDetailsAdapter extends RecyclerView.Adapter<IntrusionRecordDetailsAdapter.ViewHolder> { // // private static final String TAG = "IntrusionRecordAdapter"; // // private List<File> mPict...
import android.os.Bundle; import android.os.Environment; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.support.v7.widget.Toolbar; import android.view.MenuItem; ...
package com.createchance.doorgod.ui; public class IntrusionRecordDetailsActivity extends AppCompatActivity { private static final String TAG = "IntrusionRecordDetailsA"; private RecyclerView mDetailList;
// Path: app/src/main/java/com/createchance/doorgod/adapter/IntrusionRecordDetailsAdapter.java // public class IntrusionRecordDetailsAdapter extends RecyclerView.Adapter<IntrusionRecordDetailsAdapter.ViewHolder> { // // private static final String TAG = "IntrusionRecordAdapter"; // // private List<File> mPict...
private IntrusionRecordDetailsAdapter mAdapter;
CreateChance/DoorGod
app/src/main/java/com/createchance/doorgod/service/BootUpReceiver.java
// Path: app/src/main/java/com/createchance/doorgod/util/LogUtil.java // public class LogUtil { // public static final int VERBOSE = 1; // // public static final int DEBUG = 2; // // public static final int INFO = 3; // // public static final int WARN = 4; // // public static final int ERROR = 5...
import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.createchance.doorgod.util.LogUtil;
package com.createchance.doorgod.service; /** * */ public class BootUpReceiver extends BroadcastReceiver { private static final String TAG = "BootUpReceiver"; @Override public void onReceive(Context context, Intent intent) { String action = intent.getAction();
// Path: app/src/main/java/com/createchance/doorgod/util/LogUtil.java // public class LogUtil { // public static final int VERBOSE = 1; // // public static final int DEBUG = 2; // // public static final int INFO = 3; // // public static final int WARN = 4; // // public static final int ERROR = 5...
LogUtil.d(TAG, "action: " + action);
CreateChance/DoorGod
app/src/main/java/com/createchance/doorgod/adapter/IntrusionRecordDetailsAdapter.java
// Path: app/src/main/java/com/createchance/doorgod/util/LogUtil.java // public class LogUtil { // public static final int VERBOSE = 1; // // public static final int DEBUG = 2; // // public static final int INFO = 3; // // public static final int WARN = 4; // // public static final int ERROR = 5...
import android.content.Context; import android.content.DialogInterface; import android.support.v7.app.AlertDialog; import android.support.v7.widget.RecyclerView; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; ...
package com.createchance.doorgod.adapter; /** * Created by gaochao on 26/07/2017. */ public class IntrusionRecordDetailsAdapter extends RecyclerView.Adapter<IntrusionRecordDetailsAdapter.ViewHolder> { private static final String TAG = "IntrusionRecordAdapter"; private List<File> mPictureList; priv...
// Path: app/src/main/java/com/createchance/doorgod/util/LogUtil.java // public class LogUtil { // public static final int VERBOSE = 1; // // public static final int DEBUG = 2; // // public static final int INFO = 3; // // public static final int WARN = 4; // // public static final int ERROR = 5...
LogUtil.d(TAG, mPictureList.get(position).getAbsolutePath());
antag99/aquarria
aquarria/tests/com/github/antag99/aquarria/tests/DirectionTests.java
// Path: aquarria/src/com/github/antag99/aquarria/Direction.java // public enum Direction { // // Note that the order is important // NORTH(0, 1), // NORTHEAST(1, 1), // EAST(1, 0), // SOUTHEAST(1, -1), // SOUTH(0, -1), // SOUTHWEST(-1, -1), // WEST(-1, 0), // NORTHWEST(-1, 1); // // private static Direction...
import org.junit.Test; import com.github.antag99.aquarria.Direction; import org.junit.Assert;
/******************************************************************************* * Copyright (c) 2014-2015, Anton Gustafsson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * * Redistri...
// Path: aquarria/src/com/github/antag99/aquarria/Direction.java // public enum Direction { // // Note that the order is important // NORTH(0, 1), // NORTHEAST(1, 1), // EAST(1, 0), // SOUTHEAST(1, -1), // SOUTH(0, -1), // SOUTHWEST(-1, -1), // WEST(-1, 0), // NORTHWEST(-1, 1); // // private static Direction...
Assert.assertEquals(Direction.SOUTH, Direction.NORTH.opposite());
wxiaoqi/ace-cache
src/main/java/com/ace/cache/annotation/CacheClear.java
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator;
package com.ace.cache.annotation; /** * 解决问题: * * @author Ace * @version 1.0 * @date 2017年5月4日 * @since 1.7 */ @Retention(RetentionPolicy.RUNTIME)//在运行时可以获取 @Target(value = {ElementType.METHOD, ElementType.TYPE})//作用到类,方法,接口上等 public @interface CacheClear { /** * 缓存key的前缀 * * @return ...
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
public Class<? extends IKeyGenerator> generator() default DefaultKeyGenerator.class;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/annotation/CacheClear.java
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator;
package com.ace.cache.annotation; /** * 解决问题: * * @author Ace * @version 1.0 * @date 2017年5月4日 * @since 1.7 */ @Retention(RetentionPolicy.RUNTIME)//在运行时可以获取 @Target(value = {ElementType.METHOD, ElementType.TYPE})//作用到类,方法,接口上等 public @interface CacheClear { /** * 缓存key的前缀 * * @return ...
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
public Class<? extends IKeyGenerator> generator() default DefaultKeyGenerator.class;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/parser/IKeyGenerator.java
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // }
import com.ace.cache.constants.CacheScope;
package com.ace.cache.parser; /** * 缓存键值表达式 * * @author 小郎君 * @description * @date 2017年5月18日 * @since 1.7 */ public abstract class IKeyGenerator { public static final String LINK = "_"; /** * 获取动态key * * @param key * @param scope * @param parameterTypes * @param argument...
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java import com.ace.cache.constants.CacheScope; package com.ace.cache.parser; /** * 缓存键值表达式 * * @author 小郎君 * @description * @date ...
public String getKey(String key, CacheScope scope,
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/service/impl/UserServiceImpl.java
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheGlobalLock; import com.ace.cache.parser.ICacheResultParser; import com.ace.cache.test.cache.MyKeyGenerator; import com.ace.cache.test.entity.User; import com.ace.cache.test.service.UserService; import...
package com.ace.cache.test.service.impl; /** * Created by Ace on 2017/5/21. */ @Service @Slf4j
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
public class UserServiceImpl implements UserService {
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/service/impl/UserServiceImpl.java
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheGlobalLock; import com.ace.cache.parser.ICacheResultParser; import com.ace.cache.test.cache.MyKeyGenerator; import com.ace.cache.test.entity.User; import com.ace.cache.test.service.UserService; import...
package com.ace.cache.test.service.impl; /** * Created by Ace on 2017/5/21. */ @Service @Slf4j public class UserServiceImpl implements UserService { @Override @Cache(key = "user{1}",desc = "用户信息缓存")
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
public User get(String account) {
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/service/impl/UserServiceImpl.java
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheGlobalLock; import com.ace.cache.parser.ICacheResultParser; import com.ace.cache.test.cache.MyKeyGenerator; import com.ace.cache.test.entity.User; import com.ace.cache.test.service.UserService; import...
@Cache(key = "user:set", parser = SetCacheResultParser.class) public Set<User> getSet() { log.debug("从方法内读取...."); Set<User> users = new HashSet<User>(); for (int i = 0; i < 20; i++) { User user = new User("Ace", i, "ace"); users.add(user); } retur...
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
@Cache(key="user",generator = MyKeyGenerator.class)
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/service/impl/UserServiceImpl.java
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.CacheClear; import com.ace.cache.annotation.CacheGlobalLock; import com.ace.cache.parser.ICacheResultParser; import com.ace.cache.test.cache.MyKeyGenerator; import com.ace.cache.test.entity.User; import com.ace.cache.test.service.UserService; import...
public User get(int age) { log.debug("从方法内读取...."); User user = new User("Ace", age, "Ace"); return user; } @Override @CacheGlobalLock(key="user_lock{1}") public void biz(String account) { log.debug("注解分布式锁..."); } @Override @Cache(key="user:age{1}") ...
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
public static class UserMapCacheResultParser implements ICacheResultParser {
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/unit/UserServiceTest.java
// Path: src/test/java/com/ace/cache/test/CacheTest.java // @SpringBootApplication // @EnableAceCache // public class CacheTest { // public static void main(String args[]) { // SpringApplication app = new SpringApplication(CacheTest.class); // app.run(args); // } // // } // // Path: src/test/j...
import com.ace.cache.test.CacheTest; import com.ace.cache.test.entity.User; import com.ace.cache.test.service.UserService; import com.alibaba.fastjson.JSON; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context...
package com.ace.cache.test.unit; /** * Created by Ace on 2017/5/21. */ @RunWith(SpringJUnit4ClassRunner.class) // SpringJUnit支持,由此引入Spring-Test框架支持! @SpringBootTest(classes = CacheTest.class) // 指定我们SpringBoot工程的Application启动类 public class UserServiceTest { @Autowired
// Path: src/test/java/com/ace/cache/test/CacheTest.java // @SpringBootApplication // @EnableAceCache // public class CacheTest { // public static void main(String args[]) { // SpringApplication app = new SpringApplication(CacheTest.class); // app.run(args); // } // // } // // Path: src/test/j...
private UserService userService;
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/unit/UserServiceTest.java
// Path: src/test/java/com/ace/cache/test/CacheTest.java // @SpringBootApplication // @EnableAceCache // public class CacheTest { // public static void main(String args[]) { // SpringApplication app = new SpringApplication(CacheTest.class); // app.run(args); // } // // } // // Path: src/test/j...
import com.ace.cache.test.CacheTest; import com.ace.cache.test.entity.User; import com.ace.cache.test.service.UserService; import com.alibaba.fastjson.JSON; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context...
package com.ace.cache.test.unit; /** * Created by Ace on 2017/5/21. */ @RunWith(SpringJUnit4ClassRunner.class) // SpringJUnit支持,由此引入Spring-Test框架支持! @SpringBootTest(classes = CacheTest.class) // 指定我们SpringBoot工程的Application启动类 public class UserServiceTest { @Autowired private UserService userService; @...
// Path: src/test/java/com/ace/cache/test/CacheTest.java // @SpringBootApplication // @EnableAceCache // public class CacheTest { // public static void main(String args[]) { // SpringApplication app = new SpringApplication(CacheTest.class); // app.run(args); // } // // } // // Path: src/test/j...
User test = userService.get("test");
wxiaoqi/ace-cache
src/main/java/com/ace/cache/aspect/KeyGenerateService.java
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.CacheGlobalLock; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype....
package com.ace.cache.aspect; @Service @Slf4j public class KeyGenerateService { @Autowired
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
private IKeyGenerator keyParser;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/aspect/KeyGenerateService.java
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
import com.ace.cache.annotation.Cache; import com.ace.cache.annotation.CacheGlobalLock; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype....
package com.ace.cache.aspect; @Service @Slf4j public class KeyGenerateService { @Autowired private IKeyGenerator keyParser; private ConcurrentHashMap<String, IKeyGenerator> generatorMap = new ConcurrentHashMap<String, IKeyGenerator>(); /** * 解析表达式 * * @param anno * @param paramet...
// Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * // * @param key // * @param scope // * @param parameterTypes // * @param arguments // * @return // ...
if (anno.generator().equals(DefaultKeyGenerator.class)) {
wxiaoqi/ace-cache
src/main/java/com/ace/cache/annotation/CacheGlobalLock.java
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
import com.ace.cache.constants.CacheScope; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
package com.ace.cache.annotation; /** * 全局锁(基于redis缓存) */ @Retention(RetentionPolicy.RUNTIME) @Target(value = {ElementType.METHOD, ElementType.TYPE}) public @interface CacheGlobalLock { public String key() default ""; /** * 过期时间(单位分钟) */ public int expire() default 60; /** * 重试加锁时间...
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
public CacheScope scope() default CacheScope.application;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/annotation/CacheGlobalLock.java
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
import com.ace.cache.constants.CacheScope; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
package com.ace.cache.annotation; /** * 全局锁(基于redis缓存) */ @Retention(RetentionPolicy.RUNTIME) @Target(value = {ElementType.METHOD, ElementType.TYPE}) public @interface CacheGlobalLock { public String key() default ""; /** * 过期时间(单位分钟) */ public int expire() default 60; /** * 重试加锁时间...
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
public Class<? extends IKeyGenerator> generator() default DefaultKeyGenerator.class;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/annotation/CacheGlobalLock.java
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
import com.ace.cache.constants.CacheScope; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.impl.DefaultKeyGenerator; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target;
package com.ace.cache.annotation; /** * 全局锁(基于redis缓存) */ @Retention(RetentionPolicy.RUNTIME) @Target(value = {ElementType.METHOD, ElementType.TYPE}) public @interface CacheGlobalLock { public String key() default ""; /** * 过期时间(单位分钟) */ public int expire() default 60; /** * 重试加锁时间...
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
public Class<? extends IKeyGenerator> generator() default DefaultKeyGenerator.class;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/rest/CacheRest.java
// Path: src/main/java/com/ace/cache/service/ICacheManager.java // public interface ICacheManager { // public void removeAll(); // // public void remove(String key); // // public void remove(List<CacheBean> caches); // // public void removeByPre(String pre); // // public List<CacheTree> getAll()...
import com.ace.cache.service.ICacheManager; import com.ace.cache.utils.TreeUtils; import com.ace.cache.vo.CacheTree; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List;
package com.ace.cache.rest; @RestController @RequestMapping("cache") public class CacheRest { @Autowired
// Path: src/main/java/com/ace/cache/service/ICacheManager.java // public interface ICacheManager { // public void removeAll(); // // public void remove(String key); // // public void remove(List<CacheBean> caches); // // public void removeByPre(String pre); // // public List<CacheTree> getAll()...
private ICacheManager cacheManager;
wxiaoqi/ace-cache
src/main/java/com/ace/cache/rest/CacheRest.java
// Path: src/main/java/com/ace/cache/service/ICacheManager.java // public interface ICacheManager { // public void removeAll(); // // public void remove(String key); // // public void remove(List<CacheBean> caches); // // public void removeByPre(String pre); // // public List<CacheTree> getAll()...
import com.ace.cache.service.ICacheManager; import com.ace.cache.utils.TreeUtils; import com.ace.cache.vo.CacheTree; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List;
package com.ace.cache.rest; @RestController @RequestMapping("cache") public class CacheRest { @Autowired private ICacheManager cacheManager; @RequestMapping("/list")
// Path: src/main/java/com/ace/cache/service/ICacheManager.java // public interface ICacheManager { // public void removeAll(); // // public void remove(String key); // // public void remove(List<CacheBean> caches); // // public void removeByPre(String pre); // // public List<CacheTree> getAll()...
public List<CacheTree> listAll() {
wxiaoqi/ace-cache
src/main/java/com/ace/cache/rest/CacheRest.java
// Path: src/main/java/com/ace/cache/service/ICacheManager.java // public interface ICacheManager { // public void removeAll(); // // public void remove(String key); // // public void remove(List<CacheBean> caches); // // public void removeByPre(String pre); // // public List<CacheTree> getAll()...
import com.ace.cache.service.ICacheManager; import com.ace.cache.utils.TreeUtils; import com.ace.cache.vo.CacheTree; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import java.util.List;
package com.ace.cache.rest; @RestController @RequestMapping("cache") public class CacheRest { @Autowired private ICacheManager cacheManager; @RequestMapping("/list") public List<CacheTree> listAll() {
// Path: src/main/java/com/ace/cache/service/ICacheManager.java // public interface ICacheManager { // public void removeAll(); // // public void remove(String key); // // public void remove(List<CacheBean> caches); // // public void removeByPre(String pre); // // public List<CacheTree> getAll()...
return TreeUtils.buildTree(cacheManager.getAll());
wxiaoqi/ace-cache
src/main/java/com/ace/cache/service/ICacheManager.java
// Path: src/main/java/com/ace/cache/vo/CacheTree.java // public class CacheTree extends CacheBean { // private String id; // private String parentId; // private String text = null; // private List<CacheTree> nodes = new ArrayList<CacheTree>(); // // public CacheTree(CacheBean cache) { // t...
import com.ace.cache.entity.CacheBean; import java.util.List; import com.ace.cache.vo.CacheTree;
/** * */ package com.ace.cache.service; /** * 解决问题: * * @author Ace * @version 1.0 * @date 2017年5月3日 * @since 1.7 */ public interface ICacheManager { public void removeAll(); public void remove(String key);
// Path: src/main/java/com/ace/cache/vo/CacheTree.java // public class CacheTree extends CacheBean { // private String id; // private String parentId; // private String text = null; // private List<CacheTree> nodes = new ArrayList<CacheTree>(); // // public CacheTree(CacheBean cache) { // t...
public void remove(List<CacheBean> caches);
wxiaoqi/ace-cache
src/main/java/com/ace/cache/service/ICacheManager.java
// Path: src/main/java/com/ace/cache/vo/CacheTree.java // public class CacheTree extends CacheBean { // private String id; // private String parentId; // private String text = null; // private List<CacheTree> nodes = new ArrayList<CacheTree>(); // // public CacheTree(CacheBean cache) { // t...
import com.ace.cache.entity.CacheBean; import java.util.List; import com.ace.cache.vo.CacheTree;
/** * */ package com.ace.cache.service; /** * 解决问题: * * @author Ace * @version 1.0 * @date 2017年5月3日 * @since 1.7 */ public interface ICacheManager { public void removeAll(); public void remove(String key); public void remove(List<CacheBean> caches); public void removeByPre(String pre);
// Path: src/main/java/com/ace/cache/vo/CacheTree.java // public class CacheTree extends CacheBean { // private String id; // private String parentId; // private String text = null; // private List<CacheTree> nodes = new ArrayList<CacheTree>(); // // public CacheTree(CacheBean cache) { // t...
public List<CacheTree> getAll();
wxiaoqi/ace-cache
src/main/java/com/ace/cache/api/CacheAPI.java
// Path: src/main/java/com/ace/cache/entity/CacheBean.java // public class CacheBean { // private String key = ""; // private String desc = ""; // @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // private Date expireTime; // // public CacheBean(String key, String desc, Date expire...
import java.util.List; import com.ace.cache.entity.CacheBean;
package com.ace.cache.api; /** * 缓存API * <p/> * 解决问题: * * @author Ace * @version 1.0 * @date 2017年5月4日 * @since 1.7 */ public interface CacheAPI { /** * 传入key获取缓存json,需要用fastjson转换为对象 * * @param key * @return * @author Ace * @date 2017年5月12日 */ public String get(St...
// Path: src/main/java/com/ace/cache/entity/CacheBean.java // public class CacheBean { // private String key = ""; // private String desc = ""; // @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") // private Date expireTime; // // public CacheBean(String key, String desc, Date expire...
public List<CacheBean> getCacheBeanByPre(String pre);
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/cache/MyKeyGenerator.java
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
import com.ace.cache.constants.CacheScope; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.IUserKeyGenerator;
package com.ace.cache.test.cache; /** * ${DESCRIPTION} * * @author 小郎君 * @create 2017-05-22 14:05 */ public class MyKeyGenerator extends IKeyGenerator { @Override
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
public IUserKeyGenerator getUserKeyGenerator() {
wxiaoqi/ace-cache
src/test/java/com/ace/cache/test/cache/MyKeyGenerator.java
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
import com.ace.cache.constants.CacheScope; import com.ace.cache.parser.IKeyGenerator; import com.ace.cache.parser.IUserKeyGenerator;
package com.ace.cache.test.cache; /** * ${DESCRIPTION} * * @author 小郎君 * @create 2017-05-22 14:05 */ public class MyKeyGenerator extends IKeyGenerator { @Override public IUserKeyGenerator getUserKeyGenerator() { return null; } @Override
// Path: src/main/java/com/ace/cache/constants/CacheScope.java // public enum CacheScope { // user, application // } // // Path: src/main/java/com/ace/cache/parser/IKeyGenerator.java // public abstract class IKeyGenerator { // public static final String LINK = "_"; // // /** // * 获取动态key // * //...
public String buildKey(String key, CacheScope scope, Class<?>[] parameterTypes, Object[] arguments) {
wxiaoqi/ace-cache
src/main/java/com/ace/cache/aspect/ResultParseService.java
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
import com.ace.cache.annotation.Cache; import com.ace.cache.parser.ICacheResultParser; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.lang.reflect.Type; import java.util.concurrent.ConcurrentHashMap;
package com.ace.cache.aspect; @Slf4j @Service public class ResultParseService {
// Path: src/main/java/com/ace/cache/parser/ICacheResultParser.java // public interface ICacheResultParser { // /** // * 解析结果 // * // * @param value // * @param returnType // * @param origins // * @return // */ // public Object parse(String value, Type returnType, Class<?>... ...
private ConcurrentHashMap<String, ICacheResultParser> parserMap = new ConcurrentHashMap<String, ICacheResultParser>();
notem/Saber-Bot
src/main/java/ws/nmathe/saber/utils/HttpUtilities.java
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
import com.mashape.unirest.http.Unirest; import com.mashape.unirest.http.exceptions.UnirestException; import org.json.JSONObject; import ws.nmathe.saber.Main; import java.time.LocalDateTime; import java.time.temporal.ChronoUnit;
package ws.nmathe.saber.utils; /** */ public class HttpUtilities { private static LocalDateTime lastUpdate = LocalDateTime.MIN; /** * Updates bot metrics for any connected metric tracking services */ public static void updateStats(Integer shardId) {
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
String auth = Main.getBotSettingsManager().getWebToken();
notem/Saber-Bot
src/main/java/ws/nmathe/saber/core/settings/GuildSettingsManager.java
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
import org.bson.Document; import ws.nmathe.saber.Main; import ws.nmathe.saber.commands.general.*; import java.util.ArrayList; import java.util.Arrays; import static com.mongodb.client.model.Filters.eq; import static com.mongodb.client.model.Updates.set;
package ws.nmathe.saber.core.settings; /** * manager for guild setting options */ public class GuildSettingsManager { /** * retrieves the guild settings object for a guild * @param guildId ID of guild * @return GuildSettings object (never null) */ public GuildSettings getGuildSettings(...
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
Document guildDoc = Main.getDBDriver().getGuildCollection().find(eq("_id", guildId)).first();
notem/Saber-Bot
src/main/java/ws/nmathe/saber/utils/Logging.java
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
import ws.nmathe.saber.Main; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.time.temporal.ChronoUnit;
package ws.nmathe.saber.utils; /** * used for logging information to the console */ public class Logging { public static final String ANSI_RESET = "\u001B[0m"; public static final String ANSI_BLACK = "\u001B[30m"; public static final String ANSI_RED = "\u001B[31m"; public static final String ANSI_G...
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
if(Main.getBotSettingsManager().getLogLevel() < 5) return;
notem/Saber-Bot
src/main/java/ws/nmathe/saber/core/RateLimiter.java
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
import ws.nmathe.saber.Main; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit;
package ws.nmathe.saber.core; /** * Simple class which maintains a list of timestamps of the last command * message that a user sent (within the bot's current runtime instance) */ public class RateLimiter { private final ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
private long startThreshold = Main.getBotSettingsManager().getCooldownThreshold();
notem/Saber-Bot
src/main/java/ws/nmathe/saber/core/database/Driver.java
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
import com.mongodb.MongoClient; import com.mongodb.MongoClientURI; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import org.bson.Document; import ws.nmathe.saber.Main; import java.util.concurrent.*;
package ws.nmathe.saber.core.database; public class Driver { private MongoDatabase db; public void init() { // for a connection to the Mongo database // connection properties should be configured via the URI used in the bot toml file
// Path: src/main/java/ws/nmathe/saber/Main.java // public class Main // { // private static ShardManager shardManager; // private static BotSettingsManager botSettingsManager = new BotSettingsManager(); // private static EntryManager entryManager = new EntryManager(); // private sta...
MongoClient mongoClient = new MongoClient(new MongoClientURI(Main.getBotSettingsManager().getMongoURI()));
handstudio/HzGrapher
library/src/com/handstudio/android/hzgrapherlib/vo/linegraph/LineGraphVO.java
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
import java.util.List; import com.handstudio.android.hzgrapherlib.animation.GraphAnimation; import com.handstudio.android.hzgrapherlib.vo.Graph;
package com.handstudio.android.hzgrapherlib.vo.linegraph; public class LineGraphVO extends Graph{ //max value private int maxValue = DEFAULT_MAX_VALUE; //increment private int increment = DEFAULT_INCREMENT; //animation
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
private GraphAnimation animation = null;
handstudio/HzGrapher
library/src/com/handstudio/android/hzgraphlib/vo/scattergraph/ScatterGraphVO.java
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
import java.util.List; import com.handstudio.android.hzgrapherlib.animation.GraphAnimation; import com.handstudio.android.hzgrapherlib.vo.Graph;
package com.handstudio.android.hzgraphlib.vo.scattergraph; public class ScatterGraphVO extends Graph { public static final String TAG = ScatterGraphVO.class.getSimpleName(); private int maxValueX = 100; private int maxValueY = 100; private int incrementX = 20; private int incrementY = 20;
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
private GraphAnimation animation = null;
handstudio/HzGrapher
library/src/com/handstudio/android/hzgrapherlib/vo/radargraph/RadarGraphVO.java
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
import java.util.List; import com.handstudio.android.hzgrapherlib.animation.GraphAnimation; import com.handstudio.android.hzgrapherlib.vo.Graph; import com.handstudio.android.hzgrapherlib.vo.linegraph.LineGraph;
package com.handstudio.android.hzgrapherlib.vo.radargraph; public class RadarGraphVO extends Graph{ public static final int DEFAULT_MAX_VALUE = 100; public static final int DEFAULT_INCREMENT = 20; //max value private int maxValue = DEFAULT_MAX_VALUE; //increment private int increment = DEFAULT_INCREMENT...
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
private GraphAnimation animation = null;
handstudio/HzGrapher
library/src/com/handstudio/android/hzgrapherlib/vo/circlegraph/CircleGraphVO.java
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
import java.util.List; import android.graphics.Color; import com.handstudio.android.hzgrapherlib.animation.GraphAnimation; import com.handstudio.android.hzgrapherlib.vo.Graph;
package com.handstudio.android.hzgrapherlib.vo.circlegraph; public class CircleGraphVO extends Graph{ //animation private int radius ; private int lineColor = Color.BLACK; private int textColor = Color.BLACK; private int textSize = 20; private int graphBG = -1; private int...
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
private GraphAnimation animation = null;
handstudio/HzGrapher
library/src/com/handstudio/android/hzgrapherlib/vo/bargraph/BarGraphVO.java
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
import java.util.List; import com.handstudio.android.hzgrapherlib.animation.GraphAnimation; import com.handstudio.android.hzgrapherlib.vo.Graph;
package com.handstudio.android.hzgrapherlib.vo.bargraph; public class BarGraphVO extends Graph { private float minValueX; private float maxValueX; private float minValueY; private float maxValueY; private float incrementX; private float incrementY; private float barWidth; private int graphBG; private l...
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
private GraphAnimation animation = null;
handstudio/HzGrapher
library/src/com/handstudio/android/hzgrapherlib/vo/curvegraph/CurveGraphVO.java
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
import java.util.List; import com.handstudio.android.hzgrapherlib.animation.GraphAnimation; import com.handstudio.android.hzgrapherlib.vo.Graph;
package com.handstudio.android.hzgrapherlib.vo.curvegraph; public class CurveGraphVO extends Graph { // max value private int maxValue = DEFAULT_MAX_VALUE; // increment private int increment = DEFAULT_INCREMENT; // animation
// Path: library/src/com/handstudio/android/hzgrapherlib/animation/GraphAnimation.java // public class GraphAnimation { // public static final int LINEAR_ANIMATION = 1; // // public static final int CURVE_REGION_ANIMATION_1 = 2; // public static final int CURVE_REGION_ANIMATION_2 = 3; // // public static final ...
private GraphAnimation animation = null;
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/remote/ApiManager.java // public class ApiManager { // // private final String BASE_URL = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/"; // // private final Retrofit EARTHQUAKE_ADAPTER = new Retrofit.Builder() // ....
import io.fabric.sdk.android.Fabric; import android.app.Application; import android.content.Context; import com.adkdevelopment.earthquakesurvival.data.remote.ApiManager; import com.adkdevelopment.earthquakesurvival.eventbus.RxBus; import com.crashlytics.android.Crashlytics;
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/remote/ApiManager.java // public class ApiManager { // // private final String BASE_URL = "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/"; // // private final Retrofit EARTHQUAKE_ADAPTER = new Retrofit.Builder() // ....
private static RxBus _rxBus;
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/data/remote/EarthquakeService.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Query; import com.adkdevelopment.earthquakesurvival.data.objects.earthquake.EarthquakeObject; import com.adkdevelopment.earthquakesurvival.data.objects.info.CountEarthquakes; import com.adkdevelopment.eart...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
Call<EarthquakeObject> getData();
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/data/remote/EarthquakeService.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Query; import com.adkdevelopment.earthquakesurvival.data.objects.earthquake.EarthquakeObject; import com.adkdevelopment.earthquakesurvival.data.objects.info.CountEarthquakes; import com.adkdevelopment.eart...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
Call<Rss> getNews();
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/data/remote/EarthquakeService.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
import retrofit2.http.FormUrlEncoded; import retrofit2.http.GET; import retrofit2.http.POST; import retrofit2.http.Query; import com.adkdevelopment.earthquakesurvival.data.objects.earthquake.EarthquakeObject; import com.adkdevelopment.earthquakesurvival.data.objects.info.CountEarthquakes; import com.adkdevelopment.eart...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
Call<CountEarthquakes> getEarthquakeStats(@Query("starttime") String starttime,
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/data/remote/ApiManager.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import android.content.Context; import com.adkdevelopment.earthquakesurvival.App; import com.adkdevelopment.earthquakesurvival.R; import java.io.IOException; import java.io.InputStream; import java.security.KeyManagementException; import java.security.KeyStore; import java.security.KeyStoreException; import java.securi...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
.sslSocketFactory(getSSLConfig(App.getContext()).getSocketFactory()).build())
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/utils/Utilities.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
import android.animation.Animator; import android.app.Activity; import android.app.ActivityManager; import android.content.Context; import android.content.SharedPreferences; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.drawable.GradientDrawable; ...
if (result != ConnectionResult.SUCCESS) { if (GoogleApiAvailability.getInstance().isUserResolvableError(result)) { GoogleApiAvailability.getInstance().getErrorDialog(activity, result, 0).show(); } else { Log.e(TAG, "checkPlayServices not available"); ...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/data/objects/earthquake/EarthquakeObject.java // public class EarthquakeObject { // // @SerializedName("type") // @Expose // private String type; // @SerializedName("metadata") // @Expose // private Metadata metadata; // @Seri...
return sharedPreferences.getInt(context.getString(R.string.sharedprefs_key_sort), EarthquakeObject.SORT_TIME);
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/ui/InfoActivity.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import com.adkdevelopment.earthquakesurvival.App; import com.adkdevelopment.earthquakesurvival.R; import com.adkdevelopment.earthquakesurvival.eventbus.RxBus; import butterknife.BindView; import butterknife.ButterKnife; import rx.subscriptions.CompositeSubscription; import android.content.Intent; import android.os.Bund...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
private RxBus _rxBus;
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/ui/InfoActivity.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import com.adkdevelopment.earthquakesurvival.App; import com.adkdevelopment.earthquakesurvival.R; import com.adkdevelopment.earthquakesurvival.eventbus.RxBus; import butterknife.BindView; import butterknife.ButterKnife; import rx.subscriptions.CompositeSubscription; import android.content.Intent; import android.os.Bund...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
_rxBus = App.getRxBusSingleton();
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/ui/report_earthquake/ReportFragment.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import android.view.Menu; import android.view.MenuInflater; import android.view.MenuItem; import android.view.View; import android.view.ViewGroup; import com.adkdevelopment.earthquakesurvival.App; import com.adkdevelopment.earthquakesurvival.R; import butterknife.ButterKnife; import butterknife.Unbinder; import retrofi...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
App.getApiManager().getEarthquakeService()
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/ui/InfoFragment.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widg...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
private RxBus _rxBus;
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/ui/InfoFragment.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widg...
/* * MIT License * * Copyright (c) 2016. Dmytro Karataiev * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
_rxBus = App.getRxBusSingleton();
dmytroKarataiev/EarthquakeSurvival
app/src/main/java/com/adkdevelopment/earthquakesurvival/ui/InfoFragment.java
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
import android.content.Intent; import android.os.Bundle; import android.support.annotation.Nullable; import android.support.design.widget.FloatingActionButton; import android.support.v4.app.Fragment; import android.support.v7.app.ActionBar; import android.support.v7.app.AppCompatActivity; import android.support.v7.widg...
break; case 2: titles.addAll(Arrays.asList(getResources().getStringArray(R.array.survival_during_title))); text.addAll(Arrays.asList(getResources().getStringArray(R.array.survival_during_text))); drawable = R.drawable.earth2...
// Path: app/src/main/java/com/adkdevelopment/earthquakesurvival/App.java // public class App extends Application { // // private static ApiManager sApiManager, sNewsManager; // private static Context sContext; // // // event bus from RxJava // private static RxBus _rxBus; // // // Singleton Retr...
InfoAdapter mRecentAdapter = new InfoAdapter(titles, text);
Comcast/discovery
ha-configurator/src/main/java/com/comcast/tvx/haproxy/MappingsLoaderMain.java
// Path: discovery-client/src/main/java/com/comcast/tvx/cloud/CuratorClient.java // public class CuratorClient { // // private static Logger log = LoggerFactory.getLogger(CuratorClient.class); // // public static final int DEFAULT_MAX_SLEEP_MS = 60000; // // /** // * Gets the curator framework. // ...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import j...
/* * Copyright 2014 Comcast Corporation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed...
// Path: discovery-client/src/main/java/com/comcast/tvx/cloud/CuratorClient.java // public class CuratorClient { // // private static Logger log = LoggerFactory.getLogger(CuratorClient.class); // // public static final int DEFAULT_MAX_SLEEP_MS = 60000; // // /** // * Gets the curator framework. // ...
final CuratorFramework curatorFramework = CuratorClient.getCuratorFramework(zooKeeperConnectionString);
Comcast/discovery
discovery-client/src/main/java/com/comcast/tvx/cloud/ServiceUtil.java
// Path: discovery-client/src/main/java/com/comcast/tvx/cloud/discovery/EasyDiscoveryBuilder.java // public class EasyDiscoveryBuilder<T> { // // private CuratorFramework client; // private String basePath; // private InstanceSerializer<T> serializer; // private ServiceInstanc...
import java.util.HashMap; import java.util.Map; import java.util.UUID; import com.comcast.tvx.cloud.discovery.EasyDiscoveryBuilder; import org.apache.curator.framework.CuratorFramework; import org.apache.curator.utils.EnsurePath; import org.apache.curator.x.discovery.ServiceDiscovery; import org.apache.curator.x.discov...
ServiceInstanceBuilder<MetaData> builder = ServiceInstance.builder(); // Address is optional. The Curator library will automatically use the IP from the first // ethernet device String registerAddress = (serviceAddress == null) ? builder.build().getAddress() : serviceAddress; ...
// Path: discovery-client/src/main/java/com/comcast/tvx/cloud/discovery/EasyDiscoveryBuilder.java // public class EasyDiscoveryBuilder<T> { // // private CuratorFramework client; // private String basePath; // private InstanceSerializer<T> serializer; // private ServiceInstanc...
EasyDiscoveryBuilder.builder(MetaData.class).basePath(basePath).client(curatorFramework).build();
xedin/sasi
test/unit/org/apache/cassandra/db/index/sasi/utils/RangeUnionIteratorTest.java
// Path: src/java/org/apache/cassandra/db/index/sasi/disk/Token.java // public abstract class Token implements CombinedValue<Long>, Iterable<DecoratedKey> // { // protected final long token; // // public Token(long token) // { // this.token = token; // } // // @Override // public Long ...
import java.util.*; import java.util.concurrent.ThreadLocalRandom; import org.apache.cassandra.db.index.sasi.disk.Token; import org.apache.cassandra.io.util.FileUtils; import org.junit.Assert; import org.junit.Test; import static org.apache.cassandra.db.index.sasi.utils.LongIterator.convert;
/* * 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 ...
// Path: src/java/org/apache/cassandra/db/index/sasi/disk/Token.java // public abstract class Token implements CombinedValue<Long>, Iterable<DecoratedKey> // { // protected final long token; // // public Token(long token) // { // this.token = token; // } // // @Override // public Long ...
RangeUnionIterator.Builder<Long, Token> builder = RangeUnionIterator.builder();
xedin/sasi
test/unit/org/apache/cassandra/db/index/sasi/utils/RangeUnionIteratorTest.java
// Path: src/java/org/apache/cassandra/db/index/sasi/disk/Token.java // public abstract class Token implements CombinedValue<Long>, Iterable<DecoratedKey> // { // protected final long token; // // public Token(long token) // { // this.token = token; // } // // @Override // public Long ...
import java.util.*; import java.util.concurrent.ThreadLocalRandom; import org.apache.cassandra.db.index.sasi.disk.Token; import org.apache.cassandra.io.util.FileUtils; import org.junit.Assert; import org.junit.Test; import static org.apache.cassandra.db.index.sasi.utils.LongIterator.convert;
/* * 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 ...
// Path: src/java/org/apache/cassandra/db/index/sasi/disk/Token.java // public abstract class Token implements CombinedValue<Long>, Iterable<DecoratedKey> // { // protected final long token; // // public Token(long token) // { // this.token = token; // } // // @Override // public Long ...
Assert.assertEquals(convert(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L), convert(builder.build()));
xedin/sasi
src/java/org/apache/cassandra/db/index/sasi/conf/ColumnIndex.java
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/AbstractAnalyzer.java // public abstract class AbstractAnalyzer implements Iterator<ByteBuffer> // { // protected ByteBuffer next = null; // // @Override // public ByteBuffer next() // { // return next; // } // // @Override ...
import java.util.*; import org.apache.cassandra.config.ColumnDefinition; import org.apache.cassandra.db.index.sasi.analyzer.AbstractAnalyzer; import org.apache.cassandra.db.index.sasi.conf.view.View; import org.apache.cassandra.db.marshal.AbstractType; import org.apache.cassandra.db.marshal.AsciiType; import org.apache...
public ColumnDefinition getDefinition() { return column; } public AbstractType<?> getValidator() { return column.getValidator(); } public Component getComponent() { return component; } public IndexMode getMode() { return mode; } pub...
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/AbstractAnalyzer.java // public abstract class AbstractAnalyzer implements Iterator<ByteBuffer> // { // protected ByteBuffer next = null; // // @Override // public ByteBuffer next() // { // return next; // } // // @Override ...
public AbstractAnalyzer getAnalyzer()
xedin/sasi
src/java/org/apache/cassandra/db/index/sasi/conf/ColumnIndex.java
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/AbstractAnalyzer.java // public abstract class AbstractAnalyzer implements Iterator<ByteBuffer> // { // protected ByteBuffer next = null; // // @Override // public ByteBuffer next() // { // return next; // } // // @Override ...
import java.util.*; import org.apache.cassandra.config.ColumnDefinition; import org.apache.cassandra.db.index.sasi.analyzer.AbstractAnalyzer; import org.apache.cassandra.db.index.sasi.conf.view.View; import org.apache.cassandra.db.marshal.AbstractType; import org.apache.cassandra.db.marshal.AsciiType; import org.apache...
return column.getValidator(); } public Component getComponent() { return component; } public IndexMode getMode() { return mode; } public String getColumnName() { return comparator.getString(column.name); } public String getIndexName() {...
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/AbstractAnalyzer.java // public abstract class AbstractAnalyzer implements Iterator<ByteBuffer> // { // protected ByteBuffer next = null; // // @Override // public ByteBuffer next() // { // return next; // } // // @Override ...
public View getView()
xedin/sasi
src/java/org/apache/cassandra/db/index/sasi/analyzer/NonTokenizingAnalyzer.java
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/filter/BasicResultFilters.java // public class BasicResultFilters // { // private static final Locale DEFAULT_LOCALE = Locale.getDefault(); // // public static class LowerCase extends FilterPipelineTask<String, String> // { // private Lo...
import org.apache.cassandra.utils.ByteBufferUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.nio.ByteBuffer; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.cassandra.db.index.sasi.analyzer.filter.BasicResultFilters; import org.apache.cassandra.db.index....
@Override public void init(Map<String, String> options, AbstractType validator) { init(NonTokenizingOptions.buildFromMap(options), validator); } public void init(NonTokenizingOptions tokenizerOptions, AbstractType validator) { this.validator = validator; this.options = t...
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/filter/BasicResultFilters.java // public class BasicResultFilters // { // private static final Locale DEFAULT_LOCALE = Locale.getDefault(); // // public static class LowerCase extends FilterPipelineTask<String, String> // { // private Lo...
Object pipelineRes = FilterPipelineExecutor.execute(filterPipeline, inputStr);
xedin/sasi
src/java/org/apache/cassandra/db/index/sasi/analyzer/NonTokenizingAnalyzer.java
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/filter/BasicResultFilters.java // public class BasicResultFilters // { // private static final Locale DEFAULT_LOCALE = Locale.getDefault(); // // public static class LowerCase extends FilterPipelineTask<String, String> // { // private Lo...
import org.apache.cassandra.utils.ByteBufferUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.nio.ByteBuffer; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.cassandra.db.index.sasi.analyzer.filter.BasicResultFilters; import org.apache.cassandra.db.index....
if (pipelineRes == null || !(pipelineRes instanceof String)) return false; next = validator.fromString(normalize((String) pipelineRes)); return true; } catch (MarshalException e) { logger.error("Fail...
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/filter/BasicResultFilters.java // public class BasicResultFilters // { // private static final Locale DEFAULT_LOCALE = Locale.getDefault(); // // public static class LowerCase extends FilterPipelineTask<String, String> // { // private Lo...
FilterPipelineBuilder builder = new FilterPipelineBuilder(new BasicResultFilters.NoOperation());
xedin/sasi
src/java/org/apache/cassandra/db/index/sasi/analyzer/NonTokenizingAnalyzer.java
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/filter/BasicResultFilters.java // public class BasicResultFilters // { // private static final Locale DEFAULT_LOCALE = Locale.getDefault(); // // public static class LowerCase extends FilterPipelineTask<String, String> // { // private Lo...
import org.apache.cassandra.utils.ByteBufferUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.nio.ByteBuffer; import java.util.HashSet; import java.util.Map; import java.util.Set; import org.apache.cassandra.db.index.sasi.analyzer.filter.BasicResultFilters; import org.apache.cassandra.db.index....
if (pipelineRes == null || !(pipelineRes instanceof String)) return false; next = validator.fromString(normalize((String) pipelineRes)); return true; } catch (MarshalException e) { logger.error("Fail...
// Path: src/java/org/apache/cassandra/db/index/sasi/analyzer/filter/BasicResultFilters.java // public class BasicResultFilters // { // private static final Locale DEFAULT_LOCALE = Locale.getDefault(); // // public static class LowerCase extends FilterPipelineTask<String, String> // { // private Lo...
FilterPipelineBuilder builder = new FilterPipelineBuilder(new BasicResultFilters.NoOperation());
xedin/sasi
src/java/org/apache/cassandra/db/index/sasi/utils/trie/AbstractPatriciaTrie.java
// Path: src/java/org/apache/cassandra/db/index/sasi/utils/trie/Cursor.java // enum Decision // { // // /** // * Exit the traverse operation // */ // EXIT, // // /** // * Continue with the traverse operation // */ // CONTINUE, // // /** // * Remo...
import java.util.NoSuchElementException; import java.util.Set; import org.apache.cassandra.db.index.sasi.utils.trie.Cursor.Decision; import java.util.AbstractCollection; import java.util.AbstractSet; import java.util.Collection; import java.util.ConcurrentModificationException; import java.util.Iterator; import java.ut...
if (!isBitSet(key, h.bitIndex)) { if (selectR(h.left, h.bitIndex, key, reference)) { return selectR(h.right, h.bitIndex, key, reference); } } else { if (selectR(h.right, h.bitIndex, key, reference)) { ...
// Path: src/java/org/apache/cassandra/db/index/sasi/utils/trie/Cursor.java // enum Decision // { // // /** // * Exit the traverse operation // */ // EXIT, // // /** // * Continue with the traverse operation // */ // CONTINUE, // // /** // * Remo...
Decision decision = cursor.select(h);
cscotta/deschutes
src/main/java/com/cscotta/deschutes/json/LoggedRollupListener.java
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestEvent.java // public class RequestEvent implements Event { // // private final Request request; // // public RequestEvent(Request request) { // this.request = request; // } // // @Override // public long getTimestamp() { ...
import java.util.List; import java.util.Map; import com.cscotta.deschutes.example.requests.RequestEvent; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.cscotta.deschutes.api.ConcurrentRollup; import com.cscotta.deschutes.api.OutputListener; import com.cscotta.deschutes.json.Json; import org.codehau...
package com.cscotta.deschutes.json; public class LoggedRollupListener implements OutputListener<RequestEvent> { private final ObjectMapper jackson = new Json().objectMapper; private static final Logger log = LoggerFactory.getLogger(LoggedRollupListener.class); @Override
// Path: src/main/java/com/cscotta/deschutes/example/requests/RequestEvent.java // public class RequestEvent implements Event { // // private final Request request; // // public RequestEvent(Request request) { // this.request = request; // } // // @Override // public long getTimestamp() { ...
public void update(List<Long> remove, Map<Long, Map<String, ConcurrentRollup<RequestEvent>>> insert) {
cscotta/deschutes
src/main/java/com/cscotta/deschutes/example/requests/WebsocketRollupListener.java
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java // public interface ConcurrentRollup<Input> extends Event { // // /** // * <p>Rollup method called as events are received by a stream for // * aggregation.</p> // * // * <p>Implementations of ConcurrentRollup should accept {...
import com.cscotta.deschutes.api.ConcurrentRollup; import com.cscotta.deschutes.api.OutputListener; import com.cscotta.deschutes.example.app.websockets.OLAPWebSocket; import com.cscotta.deschutes.json.Json; import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import jav...
package com.cscotta.deschutes.example.requests; public class WebsocketRollupListener implements OutputListener<RequestEvent> { private final Set<OLAPWebSocket> users;
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java // public interface ConcurrentRollup<Input> extends Event { // // /** // * <p>Rollup method called as events are received by a stream for // * aggregation.</p> // * // * <p>Implementations of ConcurrentRollup should accept {...
private final ObjectMapper jackson = new Json().objectMapper;
cscotta/deschutes
src/main/java/com/cscotta/deschutes/example/requests/WebsocketRollupListener.java
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java // public interface ConcurrentRollup<Input> extends Event { // // /** // * <p>Rollup method called as events are received by a stream for // * aggregation.</p> // * // * <p>Implementations of ConcurrentRollup should accept {...
import com.cscotta.deschutes.api.ConcurrentRollup; import com.cscotta.deschutes.api.OutputListener; import com.cscotta.deschutes.example.app.websockets.OLAPWebSocket; import com.cscotta.deschutes.json.Json; import org.codehaus.jackson.map.ObjectMapper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import jav...
package com.cscotta.deschutes.example.requests; public class WebsocketRollupListener implements OutputListener<RequestEvent> { private final Set<OLAPWebSocket> users; private final ObjectMapper jackson = new Json().objectMapper; private static final Logger log = LoggerFactory.getLogger(WebsocketRollupLi...
// Path: src/main/java/com/cscotta/deschutes/api/ConcurrentRollup.java // public interface ConcurrentRollup<Input> extends Event { // // /** // * <p>Rollup method called as events are received by a stream for // * aggregation.</p> // * // * <p>Implementations of ConcurrentRollup should accept {...
public void update(List<Long> remove, Map<Long, Map<String, ConcurrentRollup<RequestEvent>>> insert) {