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 |
|---|---|---|---|---|---|---|
codeforkjeff/conciliator | src/main/java/com/codefork/refine/viaf/VIAFProxyModeMetaDataResponse.java | // Path: src/main/java/com/codefork/refine/resources/View.java
// public class View {
// private String url;
//
// public View(String url) {
// this.url = url;
// }
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = ... | import com.codefork.refine.resources.View;
import com.codefork.refine.viaf.sources.NonVIAFSource; | package com.codefork.refine.viaf;
/**
* Service metadata for "proxy mode": the important thing here is
* "view" key contains URL template for the non-VIAF source (for example,
* the LC website) rather than for VIAF.
*/
public class VIAFProxyModeMetaDataResponse extends VIAFMetaDataResponse {
private String u... | // Path: src/main/java/com/codefork/refine/resources/View.java
// public class View {
// private String url;
//
// public View(String url) {
// this.url = url;
// }
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = ... | public VIAFProxyModeMetaDataResponse(NonVIAFSource nonVIAFSource, String baseUrl) { |
codeforkjeff/conciliator | src/main/java/com/codefork/refine/viaf/VIAFProxyModeMetaDataResponse.java | // Path: src/main/java/com/codefork/refine/resources/View.java
// public class View {
// private String url;
//
// public View(String url) {
// this.url = url;
// }
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = ... | import com.codefork.refine.resources.View;
import com.codefork.refine.viaf.sources.NonVIAFSource; | package com.codefork.refine.viaf;
/**
* Service metadata for "proxy mode": the important thing here is
* "view" key contains URL template for the non-VIAF source (for example,
* the LC website) rather than for VIAF.
*/
public class VIAFProxyModeMetaDataResponse extends VIAFMetaDataResponse {
private String u... | // Path: src/main/java/com/codefork/refine/resources/View.java
// public class View {
// private String url;
//
// public View(String url) {
// this.url = url;
// }
//
// public String getUrl() {
// return url;
// }
//
// public void setUrl(String url) {
// this.url = ... | public View getView() { |
codeforkjeff/conciliator | src/test/java/com/codefork/refine/solr/SolrParserTest.java | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | import com.codefork.refine.resources.NameType;
import com.codefork.refine.resources.Result;
import org.junit.Test;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.InputStream;
import java.util.List;
import static org.junit.Assert.assertEquals; | package com.codefork.refine.solr;
public class SolrParserTest {
@Test
public void testParse() throws Exception {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser parser = spf.newSAXParser(); | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | SolrParser solrParser = new SolrParser("id", "title_display", null, null, new NameType("/book/book", "Book")); |
codeforkjeff/conciliator | src/test/java/com/codefork/refine/solr/SolrParserTest.java | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | import com.codefork.refine.resources.NameType;
import com.codefork.refine.resources.Result;
import org.junit.Test;
import javax.xml.parsers.SAXParser;
import javax.xml.parsers.SAXParserFactory;
import java.io.InputStream;
import java.util.List;
import static org.junit.Assert.assertEquals; | package com.codefork.refine.solr;
public class SolrParserTest {
@Test
public void testParse() throws Exception {
SAXParserFactory spf = SAXParserFactory.newInstance();
SAXParser parser = spf.newSAXParser();
SolrParser solrParser = new SolrParser("id", "title_display", null, null, ne... | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | List<Result> results = solrParser.getResults(); |
codeforkjeff/conciliator | src/main/java/com/codefork/refine/solr/SolrMetaDataResponse.java | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | import com.codefork.refine.resources.NameType;
import com.codefork.refine.resources.ServiceMetaDataResponse;
import com.codefork.refine.resources.View;
import com.codefork.refine.viaf.VIAFNameType;
import java.util.ArrayList;
import java.util.List; | package com.codefork.refine.solr;
public class SolrMetaDataResponse extends ServiceMetaDataResponse {
private final static String IDENTIFIER_SPACE = "http://rdf.freebase.com/ns/user/hangy/viaf";
private final static String SCHEMA_SPACE = "http://rdf.freebase.com/ns/type.object.id"; | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | private final static List<NameType> DEFAULT_TYPES = new ArrayList<>(); |
codeforkjeff/conciliator | src/main/java/com/codefork/refine/solr/SolrMetaDataResponse.java | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | import com.codefork.refine.resources.NameType;
import com.codefork.refine.resources.ServiceMetaDataResponse;
import com.codefork.refine.resources.View;
import com.codefork.refine.viaf.VIAFNameType;
import java.util.ArrayList;
import java.util.List; | package com.codefork.refine.solr;
public class SolrMetaDataResponse extends ServiceMetaDataResponse {
private final static String IDENTIFIER_SPACE = "http://rdf.freebase.com/ns/user/hangy/viaf";
private final static String SCHEMA_SPACE = "http://rdf.freebase.com/ns/type.object.id";
private final static ... | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | private View view; |
codeforkjeff/conciliator | src/main/java/com/codefork/refine/solr/SolrMetaDataResponse.java | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | import com.codefork.refine.resources.NameType;
import com.codefork.refine.resources.ServiceMetaDataResponse;
import com.codefork.refine.resources.View;
import com.codefork.refine.viaf.VIAFNameType;
import java.util.ArrayList;
import java.util.List; | package com.codefork.refine.solr;
public class SolrMetaDataResponse extends ServiceMetaDataResponse {
private final static String IDENTIFIER_SPACE = "http://rdf.freebase.com/ns/user/hangy/viaf";
private final static String SCHEMA_SPACE = "http://rdf.freebase.com/ns/type.object.id";
private final static ... | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | for(VIAFNameType nameType : VIAFNameType.values()) { |
codeforkjeff/conciliator | src/main/java/com/codefork/refine/SearchResult.java | // Path: src/main/java/com/codefork/refine/resources/Result.java
// public class Result {
//
// private String id;
// private String name;
//
// /**
// * It's weird that this is a list but that's what OpenRefine expects.
// * A VIAF result only ever has one type, but maybe other reconciliati... | import com.codefork.refine.resources.Result;
import java.util.List; | package com.codefork.refine;
/**
*/
public class SearchResult {
public enum ErrorType {
UNKNOWN, TOO_MANY_REQUESTS
}
private String key; | // Path: src/main/java/com/codefork/refine/resources/Result.java
// public class Result {
//
// private String id;
// private String name;
//
// /**
// * It's weird that this is a list but that's what OpenRefine expects.
// * A VIAF result only ever has one type, but maybe other reconciliati... | private List<Result> results; |
codeforkjeff/conciliator | src/main/java/com/codefork/refine/SearchQuery.java | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | import com.codefork.refine.resources.NameType;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map; |
package com.codefork.refine;
/**
* Represents a single query in a request sent by Open Refine.
* For the JSON format of this query, see
* https://github.com/OpenRefine/OpenRefine/wiki/Reconciliation-Service-API
*
* There's not much documentation about the type_strict field:
* when it's set, it's always "shoul... | // Path: src/main/java/com/codefork/refine/resources/NameType.java
// public class NameType {
//
// private String id;
// private String name;
//
// public NameType(String id, String name) {
// this.id = id;
// this.name = name;
// }
//
// public String getId() {
// return... | private NameType nameType; |
Germanet-sfs/GermaNetApi | src/main/java/de/tuebingen/uni/sfs/germanet/api/StaxLoader.java | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
//
// Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int NUMBER_OF_GERMANET_FILES = 55;
| import static de.tuebingen.uni.sfs.germanet.api.GermaNet.GNROOT_ID;
import static de.tuebingen.uni.sfs.germanet.api.GermaNet.NUMBER_OF_GERMANET_FILES;
import java.io.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastuti... | Object2ObjectMap<String, ObjectSet<String>> lowerToUpperMap = new Object2ObjectOpenHashMap<>();
ObjectIterator<Synset> synsetIterator;
ObjectIterator<LexUnit> lexUnitIterator;
List<Synset> synsetsFromInputStream;
Synset synset;
LexUnit lexUnit;
Set<Synset> synset... | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
//
// Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int NUMBER_OF_GERMANET_FILES = 55;
// Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/StaxLoader.... | if (synset.getId() == GNROOT_ID) { |
Germanet-sfs/GermaNetApi | src/main/java/de/tuebingen/uni/sfs/germanet/api/StaxLoader.java | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
//
// Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int NUMBER_OF_GERMANET_FILES = 55;
| import static de.tuebingen.uni.sfs.germanet.api.GermaNet.GNROOT_ID;
import static de.tuebingen.uni.sfs.germanet.api.GermaNet.NUMBER_OF_GERMANET_FILES;
import java.io.*;
import java.util.List;
import java.util.Map;
import java.util.Set;
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
import it.unimi.dsi.fastuti... | orthForm = lexUnit.getOrthForm();
StaxLoader.processOrthForm(orthForm, lexUnit, mapAllOrthForms, lowerToUpperMap);
// get orthVar
// add orthVar and lowercase orthVar to lowerToUpperMap
orthForm = lexUnit.getOrthVar();
... | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
//
// Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int NUMBER_OF_GERMANET_FILES = 55;
// Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/StaxLoader.... | if (loadedFiles >= NUMBER_OF_GERMANET_FILES) { |
Germanet-sfs/GermaNetApi | src/test/java/de/tuebingen/uni/sfs/germanet/api/R14SemanticUtilsTest.java | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
| import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.*;
import java.util.stream.Stream;
import static de.tuebingen.uni.sfs.germanet.api.GermaNet.GNROOT_ID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import c... | new LeastCommonSubsumer(krautID, Sets.newHashSet(krautID, heilpflanzeID), 1)
);
return Stream.of(
Arguments.of("Apfel - Birne -> Kernobst", apfelID, birneID, apfelBirneExpected),
Arguments.of("Apfel - Baum -> Objekt", apfelID, baumID, apfelBaumExpected),
... | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
// Path: src/test/java/de/tuebingen/uni/sfs/germanet/api/R14SemanticUtilsTest.java
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.*;
import java.util.stream.St... | new LeastCommonSubsumer(GNROOT_ID, Sets.newHashSet(regressivID, denunziatorischID), 18) |
Germanet-sfs/GermaNetApi | src/test/java/de/tuebingen/uni/sfs/germanet/api/R16SemanticUtilsTest.java | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
| import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.*;
import java.util.stream.Stream;
import static de.tuebingen.uni.sfs.germanet.api.GermaNet.GNROOT_ID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import c... | new LeastCommonSubsumer(krautID, Sets.newHashSet(krautID, heilpflanzeID), 1)
);
return Stream.of(
Arguments.of("Apfel - Birne -> Kernobst", apfelID, birneID, apfelBirneExpected),
Arguments.of("Apfel - Baum -> Objekt", apfelID, baumID, apfelBaumExpected),
... | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
// Path: src/test/java/de/tuebingen/uni/sfs/germanet/api/R16SemanticUtilsTest.java
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.*;
import java.util.stream.St... | new LeastCommonSubsumer(GNROOT_ID, Sets.newHashSet(regressivID, denunziatorischID), 18) |
Germanet-sfs/GermaNetApi | src/test/java/de/tuebingen/uni/sfs/germanet/api/R15SemanticUtilsTest.java | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
| import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.*;
import java.util.stream.Stream;
import static de.tuebingen.uni.sfs.germanet.api.GermaNet.GNROOT_ID;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import c... | new LeastCommonSubsumer(krautID, Sets.newHashSet(krautID, heilpflanzeID), 1)
);
return Stream.of(
Arguments.of("Apfel - Birne -> Kernobst", apfelID, birneID, apfelBirneExpected),
Arguments.of("Apfel - Baum -> Objekt", apfelID, baumID, apfelBaumExpected),
... | // Path: src/main/java/de/tuebingen/uni/sfs/germanet/api/GermaNet.java
// public static final int GNROOT_ID = 51001;
// Path: src/test/java/de/tuebingen/uni/sfs/germanet/api/R15SemanticUtilsTest.java
import javax.xml.stream.XMLStreamException;
import java.io.IOException;
import java.util.*;
import java.util.stream.St... | new LeastCommonSubsumer(GNROOT_ID, Sets.newHashSet(regressivID, denunziatorischID), 18) |
Yeamy/SqlBuilder | src/com/yeamy/sql/statement/AlterTable.java | // Path: src/com/yeamy/sql/statement/columninfo/ColumnInfo.java
// public abstract class ColumnInfo<T extends ColumnInfo<T>> implements SQLString {
// public static final Object NO_DEFAULT = "NO_DEFAULT";
//
// private boolean primary;
// private boolean notNull;
// private Object _default = NO_DEFAULT;
// protec... | import java.util.ArrayList;
import com.yeamy.sql.statement.columninfo.ColumnInfo; | package com.yeamy.sql.statement;
public class AlterTable implements SQLString {
private String table;
private ArrayList<SQLString> columns = new ArrayList<>();
public AlterTable(String table) {
this.table = table;
}
// column
| // Path: src/com/yeamy/sql/statement/columninfo/ColumnInfo.java
// public abstract class ColumnInfo<T extends ColumnInfo<T>> implements SQLString {
// public static final Object NO_DEFAULT = "NO_DEFAULT";
//
// private boolean primary;
// private boolean notNull;
// private Object _default = NO_DEFAULT;
// protec... | public AlterTable add(String column, ColumnInfo dataType) { |
Yeamy/SqlBuilder | src/com/yeamy/sql/statement/function/IfNull.java | // Path: src/com/yeamy/sql/statement/AbsColumn.java
// public abstract class AbsColumn<T extends AbsColumn<T>> implements SQLString {
// protected String nameAlias;
//
// @SuppressWarnings("unchecked")
// public T as(String nameAlias) {
// this.nameAlias = nameAlias;
// return (T) this;
// }
//
// /**
// *... | import com.yeamy.sql.statement.AbsColumn;
import com.yeamy.sql.statement.SQLString; | package com.yeamy.sql.statement.function;
public class IfNull extends AbsColumn<IfNull> {
private Object col, whenNull;
public IfNull(Object col, Object whenNull) {
this(col, whenNull, null);
}
public IfNull(Object col, Object whenNull, String nameAlias) {
this.col = col;
this.whenNull = whenNull;
this.... | // Path: src/com/yeamy/sql/statement/AbsColumn.java
// public abstract class AbsColumn<T extends AbsColumn<T>> implements SQLString {
// protected String nameAlias;
//
// @SuppressWarnings("unchecked")
// public T as(String nameAlias) {
// this.nameAlias = nameAlias;
// return (T) this;
// }
//
// /**
// *... | SQLString.appendValue(sb, col); |
Yeamy/SqlBuilder | src/com/yeamy/sql/statement/function/Virtual.java | // Path: src/com/yeamy/sql/statement/AbsColumn.java
// public abstract class AbsColumn<T extends AbsColumn<T>> implements SQLString {
// protected String nameAlias;
//
// @SuppressWarnings("unchecked")
// public T as(String nameAlias) {
// this.nameAlias = nameAlias;
// return (T) this;
// }
//
// /**
// *... | import com.yeamy.sql.statement.AbsColumn;
import com.yeamy.sql.statement.SQLString; | package com.yeamy.sql.statement.function;
public class Virtual extends AbsColumn<Virtual> {
private Object value;
public Virtual(Object value, String nameAlias) {
this.value = value;
this.nameAlias = nameAlias;
}
@Override
public void toSQL(StringBuilder sb) { | // Path: src/com/yeamy/sql/statement/AbsColumn.java
// public abstract class AbsColumn<T extends AbsColumn<T>> implements SQLString {
// protected String nameAlias;
//
// @SuppressWarnings("unchecked")
// public T as(String nameAlias) {
// this.nameAlias = nameAlias;
// return (T) this;
// }
//
// /**
// *... | SQLString.appendValue(sb, value); |
Yeamy/SqlBuilder | src/com/yeamy/sql/statement/CreateTable.java | // Path: src/com/yeamy/sql/statement/columninfo/ColumnInfo.java
// public abstract class ColumnInfo<T extends ColumnInfo<T>> implements SQLString {
// public static final Object NO_DEFAULT = "NO_DEFAULT";
//
// private boolean primary;
// private boolean notNull;
// private Object _default = NO_DEFAULT;
// protec... | import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.Map.Entry;
import com.yeamy.sql.statement.columninfo.ColumnInfo; | package com.yeamy.sql.statement;
public class CreateTable implements SQLString {
private String database;
private String table; | // Path: src/com/yeamy/sql/statement/columninfo/ColumnInfo.java
// public abstract class ColumnInfo<T extends ColumnInfo<T>> implements SQLString {
// public static final Object NO_DEFAULT = "NO_DEFAULT";
//
// private boolean primary;
// private boolean notNull;
// private Object _default = NO_DEFAULT;
// protec... | private LinkedHashMap<String, ColumnInfo> columns = new LinkedHashMap<>(); |
Yeamy/SqlBuilder | src/com/yeamy/sql/statement/function/Expression.java | // Path: src/com/yeamy/sql/statement/AbsColumn.java
// public abstract class AbsColumn<T extends AbsColumn<T>> implements SQLString {
// protected String nameAlias;
//
// @SuppressWarnings("unchecked")
// public T as(String nameAlias) {
// this.nameAlias = nameAlias;
// return (T) this;
// }
//
// /**
// *... | import com.yeamy.sql.statement.AbsColumn;
import com.yeamy.sql.statement.SQLString; | package com.yeamy.sql.statement.function;
public class Expression extends AbsColumn<Expression> {
private static final char[] symbol = { '+', '-', '*', '/', '%', '(', ')', '|', '>', '<', '=' };
private Object[] objs;
/**
* @param Object {@code AbsColumn}<br>
* {@code Searchable}<br>
* ... | // Path: src/com/yeamy/sql/statement/AbsColumn.java
// public abstract class AbsColumn<T extends AbsColumn<T>> implements SQLString {
// protected String nameAlias;
//
// @SuppressWarnings("unchecked")
// public T as(String nameAlias) {
// this.nameAlias = nameAlias;
// return (T) this;
// }
//
// /**
// *... | SQLString.appendValue(sb, str); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/math_utils/MathUtilities.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.math3.stat.descriptive.moment.... | }
else {
return number.setScale(scale, roundingMode);
}
}
else {
return number.setScale(scale, roundingMode);
}
}
public static BigDecimal computePopulationStandardDeviationOfBigDecimals(List<BigDecimal> numbers) {
... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/metric_formats/opentsdb/OpenTsdbHttpOutputModule.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.net.URL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package com.pearson.statspoller.metric_formats.opentsdb;
/**
* @author Jeffrey Schmidt
*/
public class OpenTsdbHttpOutputModule {
private static final Logger logger = LoggerFactory.getLogger(OpenTsdbHttpOutputModule.class.getName());
private final boolean isOutputEnabled_;
private final String... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/web_utils/HttpUtils.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.net.URLEncoder;
import org.apache.commons.codec.binary.Base64;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; |
int colonIndex = credentialsString.indexOf(':');
if ((colonIndex > -1) && (colonIndex < (credentialsString.length() - 1))) {
String username = credentialsString.substring(0, colonIndex);
String password = credentialsString.substring(colonIndex + 1... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/db_utils/DatabaseUtils.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import com.google.common.collect.Lists;
import java.io.BufferedReader;
import java.math.BigDecimal;
import java.sql.BatchUpdateException;
import java.sql.Blob;
import java.sql.Clob;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql... | cleanup(null, preparedStatement, null, null, CLOSE);
}
public static void cleanup(PreparedStatement preparedStatement, ResultSet results) {
cleanup(null, preparedStatement, null, results, CLOSE);
}
public static void cleanup(Connection connection, PreparedStatement preparedStat... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/network_utils/TcpClient.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.io.BufferedWriter;
import java.io.DataOutputStream;
import java.io.OutputStreamWriter;
import java.net.InetSocketAddress;
import java.net.Socket;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | private DataOutputStream dataOutputStream_ = null;
public TcpClient(String host, int port, boolean connectImmediately, int socketConnectionTimeoutInMs) {
this.host_ = host;
this.port_ = port;
this.socketConnectionTimeoutInMs_ = socketConnectionTimeoutInMs;
i... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/time_utils/DateAndTime.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package com.pearson.statspoller.utilities.time_utils;
/**
* @author Jeffrey Schmidt
*/
public class DateAndTime {
private static final Logger logger = LoggerFactory.getLogger(DateAndTime.class.getName());
public static final int COMPARE_ERROR_CODE = -44444444;
public static String getFormattedCur... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/string_utils/StringUtilities.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import org.apache.commons.lang... | package com.pearson.statspoller.utilities.string_utils;
/**
* @author Jeffrey Schmidt
*/
public class StringUtilities {
private static final Logger logger = LoggerFactory.getLogger(StringUtilities.class.getName());
private static final Map<String,Charset> charsetCache = new ConcurrentHashMap<>();
... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/json_utils/JsonUtils.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonPrimitive;
import com.pearson.statspoller.utilities.core_utils.StackTrace;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package com.pearson.statspoller.utilities.json_utils;
/**
* @author Jeffrey Schmidt
*/
public class JsonUtils {
private static final Logger logger = LoggerFactory.getLogger(JsonUtils.class.getName());
public static Integer getIntegerFieldFromJsonObject(JsonObject jsonObject, String fieldName) {
... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/utilities/os_utils/ProcessUtils.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package com.pearson.statspoller.utilities.os_utils;
/**
* @author Jeffrey Schmidt
*/
public class ProcessUtils {
private static final Logger logger = LoggerFactory.getLogger(ProcessUtils.class.getName());
public static String runProcessAndGetProcessOutput(String commands) {
String out... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
PearsonEducation/StatsPoller | src/main/java/com/pearson/statspoller/external_metric_collectors/ExternalMetricCollector.java | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | import com.pearson.statspoller.utilities.core_utils.StackTrace;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; | package com.pearson.statspoller.external_metric_collectors;
/**
* @author Jeffrey Schmidt
*/
public class ExternalMetricCollector {
private static final Logger logger = LoggerFactory.getLogger(ExternalMetricCollector.class.getName());
private final String programPathAndFilename_;
private final... | // Path: src/main/java/com/pearson/statspoller/utilities/core_utils/StackTrace.java
// public class StackTrace {
//
// private static final Logger logger = LoggerFactory.getLogger(StackTrace.class.getName());
//
// public static String getStringFromStackTrace(Exception exception) {
// try {
//... | logger.error(e.toString() + System.lineSeparator() + StackTrace.getStringFromStackTrace(e)); |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/BitBucketFileMetadata.java | // Path: src/main/java/org/springframework/social/bitbucket/api/impl/UTCDateDeserializer.java
// public class UTCDateDeserializer extends JsonDeserializer<Date> {
//
// @Override
// public Date deserialize(JsonParser jp, DeserializationContext ctxt)
// throws IOException, JsonProcessingException {
... | import java.util.Date;
import org.springframework.social.bitbucket.api.impl.UTCDateDeserializer;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/impl/UTCDateDeserializer.java
// public class UTCDateDeserializer extends JsonDeserializer<Date> {
//
// @Override
// public Date deserialize(JsonParser jp, DeserializationContext ctxt)
// throws IOException, JsonProcessingException {
... | @JsonDeserialize(using = UTCDateDeserializer.class) |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/security/BitBucketAuthenticationService.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | import org.springframework.social.bitbucket.api.BitBucket;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.security.provider.OAuth1AuthenticationService;
import org.springframework.social.security.provider.SocialAuthenticationService; | /*
* Copyright 2013 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 applica... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | super(new BitBucketConnectionFactory(apiKey, appSecret)); |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/UserTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketUser.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketUser implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// @JsonProperty
// private String username;
//
// @JsonP... | import java.util.List;
import org.springframework.social.bitbucket.api.BitBucketUser;
import org.springframework.social.bitbucket.api.UserOperations;
import org.springframework.social.bitbucket.api.UserWithRepositories;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.annotation.JsonIgno... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketUser.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketUser implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// @JsonProperty
// private String username;
//
// @JsonP... | public UserWithRepositories getUserWithRepositories() { |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/UserTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketUser.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketUser implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// @JsonProperty
// private String username;
//
// @JsonP... | import java.util.List;
import org.springframework.social.bitbucket.api.BitBucketUser;
import org.springframework.social.bitbucket.api.UserOperations;
import org.springframework.social.bitbucket.api.UserWithRepositories;
import org.springframework.web.client.RestTemplate;
import com.fasterxml.jackson.annotation.JsonIgno... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketUser.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketUser implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// @JsonProperty
// private String username;
//
// @JsonP... | public List<BitBucketUser> getFollowers(String user) { |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/BitBucketRepository.java | // Path: src/main/java/org/springframework/social/bitbucket/api/impl/UTCDateDeserializer.java
// public class UTCDateDeserializer extends JsonDeserializer<Date> {
//
// @Override
// public Date deserialize(JsonParser jp, DeserializationContext ctxt)
// throws IOException, JsonProcessingException {
... | import java.io.Serializable;
import java.util.Date;
import org.springframework.social.bitbucket.api.impl.UTCDateDeserializer;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/impl/UTCDateDeserializer.java
// public class UTCDateDeserializer extends JsonDeserializer<Date> {
//
// @Override
// public Date deserialize(JsonParser jp, DeserializationContext ctxt)
// throws IOException, JsonProcessingException {
... | @JsonDeserialize(using = UTCDateDeserializer.class) |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/connect/BitBucketAdapter.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | import org.springframework.social.ApiException;
import org.springframework.social.bitbucket.api.BitBucket;
import org.springframework.social.bitbucket.api.BitBucketUser;
import org.springframework.social.connect.ApiAdapter;
import org.springframework.social.connect.ConnectionValues;
import org.springframework.social.co... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | BitBucketUser user = api.userOperations().getUserWithRepositories() |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/connect/BitBucketServiceProvider.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | import org.springframework.social.bitbucket.api.BitBucket;
import org.springframework.social.bitbucket.api.impl.BitBucketTemplate;
import org.springframework.social.oauth1.AbstractOAuth1ServiceProvider;
import org.springframework.social.oauth1.OAuth1Template; | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | return new BitBucketTemplate(getConsumerKey(), getConsumerSecret(), |
ericbottard/spring-social-bitbucket | src/test/java/org/springframework/social/bitbucket/api/impl/PrivilegeTemplateTest.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/RepoPrivilege.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class RepoPr... | import static org.junit.Assert.*;
import static org.springframework.http.HttpMethod.*;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
import static org.springframework.test.web.client.response.MockRestResponseCreators.*;
import java.util.List;
import org.junit.Test;
import org.spring... | package org.springframework.social.bitbucket.api.impl;
public class PrivilegeTemplateTest extends BaseTemplateTest {
@Test
public void testGetRepoPrivileges() {
mockServer
.expect(requestTo("https://api.bitbucket.org/1.0/privileges/evzijst/test"))
.andExpect(method(G... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/RepoPrivilege.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class RepoPr... | List<RepoPrivilege> privs = bitBucket.privelegesOperations() |
ericbottard/spring-social-bitbucket | src/test/java/org/springframework/social/bitbucket/api/impl/PrivilegeTemplateTest.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/RepoPrivilege.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class RepoPr... | import static org.junit.Assert.*;
import static org.springframework.http.HttpMethod.*;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
import static org.springframework.test.web.client.response.MockRestResponseCreators.*;
import java.util.List;
import org.junit.Test;
import org.spring... | package org.springframework.social.bitbucket.api.impl;
public class PrivilegeTemplateTest extends BaseTemplateTest {
@Test
public void testGetRepoPrivileges() {
mockServer
.expect(requestTo("https://api.bitbucket.org/1.0/privileges/evzijst/test"))
.andExpect(method(G... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/RepoPrivilege.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class RepoPr... | assertEquals(BitBucketPrivilege.read, privs.get(0).getPrivilege()); |
ericbottard/spring-social-bitbucket | src/test/java/org/springframework/social/bitbucket/api/impl/UserTemplateTest.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketRepository.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketRepository implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// @JsonProperty("is_private")
// private boolean ... | import static org.junit.Assert.*;
import static org.springframework.http.HttpMethod.*;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.*;
import static org.springframework.test.web.client.response.MockRestResponseCreators.*;
import java.text.SimpleDateFormat;
import java.util.List;
impor... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketRepository.java
// @JsonIgnoreProperties(ignoreUnknown = true)
// public class BitBucketRepository implements Serializable {
//
// private static final long serialVersionUID = 1L;
//
// @JsonProperty("is_private")
// private boolean ... | UserWithRepositories profile = bitBucket.userOperations() |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/config/xml/BitBucketConfigBeanDefinitionParser.java | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | import org.springframework.social.bitbucket.config.support.BitBucketApiHelper;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.bitbucket.security.BitBucketAuthenticationService;
import org.springframework.social.config.xml.AbstractProviderConfigBeanDefin... | /*
* Copyright 2013 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 applica... | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | super(BitBucketConnectionFactory.class, BitBucketApiHelper.class); |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/config/xml/BitBucketConfigBeanDefinitionParser.java | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | import org.springframework.social.bitbucket.config.support.BitBucketApiHelper;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.bitbucket.security.BitBucketAuthenticationService;
import org.springframework.social.config.xml.AbstractProviderConfigBeanDefin... | /*
* Copyright 2013 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 applica... | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | super(BitBucketConnectionFactory.class, BitBucketApiHelper.class); |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/config/xml/BitBucketConfigBeanDefinitionParser.java | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | import org.springframework.social.bitbucket.config.support.BitBucketApiHelper;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.bitbucket.security.BitBucketAuthenticationService;
import org.springframework.social.config.xml.AbstractProviderConfigBeanDefin... | /*
* Copyright 2013 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 applica... | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | return BitBucketAuthenticationService.class; |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/PrivilegeTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/PrivilegeOperations.java
// public interface PrivilegeOperations {
//
// /**
// ... | import static java.util.Arrays.*;
import java.util.List;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.social.bitbucket.api.BitBucketPrivilege;
import org.springframework.social.bitbucket.api.PrivilegeOperations;
import org.springframework.social.bitb... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/PrivilegeOperations.java
// public interface PrivilegeOperations {
//
// /**
// ... | public List<RepoPrivilege> getRepoPrivileges(String user, String repoSlug) { |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/PrivilegeTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/PrivilegeOperations.java
// public interface PrivilegeOperations {
//
// /**
// ... | import static java.util.Arrays.*;
import java.util.List;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.social.bitbucket.api.BitBucketPrivilege;
import org.springframework.social.bitbucket.api.PrivilegeOperations;
import org.springframework.social.bitb... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucketPrivilege.java
// public enum BitBucketPrivilege {
//
// read, write, admin;
//
// }
//
// Path: src/main/java/org/springframework/social/bitbucket/api/PrivilegeOperations.java
// public interface PrivilegeOperations {
//
// /**
// ... | String recipient, BitBucketPrivilege privilege) { |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/BitBucketTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | import org.springframework.social.bitbucket.api.BitBucket;
import org.springframework.social.bitbucket.api.PrivilegeOperations;
import org.springframework.social.bitbucket.api.RepoOperations;
import org.springframework.social.bitbucket.api.UserOperations;
import org.springframework.social.oauth1.AbstractOAuth1ApiBindin... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | private UserOperations userOperations; |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/BitBucketTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | import org.springframework.social.bitbucket.api.BitBucket;
import org.springframework.social.bitbucket.api.PrivilegeOperations;
import org.springframework.social.bitbucket.api.RepoOperations;
import org.springframework.social.bitbucket.api.UserOperations;
import org.springframework.social.oauth1.AbstractOAuth1ApiBindin... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | private RepoOperations repoOperations; |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/api/impl/BitBucketTemplate.java | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | import org.springframework.social.bitbucket.api.BitBucket;
import org.springframework.social.bitbucket.api.PrivilegeOperations;
import org.springframework.social.bitbucket.api.RepoOperations;
import org.springframework.social.bitbucket.api.UserOperations;
import org.springframework.social.oauth1.AbstractOAuth1ApiBindin... | /**
* Copyright 2012 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 applic... | // Path: src/main/java/org/springframework/social/bitbucket/api/BitBucket.java
// public interface BitBucket extends ApiBinding {
//
// /**
// * Returns the portion of the BitBucket API that allow interaction with
// * repositories.
// */
// RepoOperations repoOperations();
//
// /**
// ... | private PrivilegeOperations privilegeOperations; |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/config/annotation/TwitterProviderConfigRegistrar.java | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.social.bitbucket.config.support.BitBucketApiHelper;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.bitbucket.security.BitBucketAuthenticationService;... | package org.springframework.social.bitbucket.config.annotation;
/**
* {@link ImportBeanDefinitionRegistrar} for configuring a
* {@link TwitterConnectionFactory} bean and a request-scoped {@link Twitter}
* bean.
*
* @author Craig Walls
*/
public class TwitterProviderConfigRegistrar extends
AbstractProvi... | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | super(EnableBitBucket.class, BitBucketConnectionFactory.class, |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/config/annotation/TwitterProviderConfigRegistrar.java | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.social.bitbucket.config.support.BitBucketApiHelper;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.bitbucket.security.BitBucketAuthenticationService;... | package org.springframework.social.bitbucket.config.annotation;
/**
* {@link ImportBeanDefinitionRegistrar} for configuring a
* {@link TwitterConnectionFactory} bean and a request-scoped {@link Twitter}
* bean.
*
* @author Craig Walls
*/
public class TwitterProviderConfigRegistrar extends
AbstractProvi... | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | BitBucketApiHelper.class); |
ericbottard/spring-social-bitbucket | src/main/java/org/springframework/social/bitbucket/config/annotation/TwitterProviderConfigRegistrar.java | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | import org.springframework.context.annotation.ImportBeanDefinitionRegistrar;
import org.springframework.social.bitbucket.config.support.BitBucketApiHelper;
import org.springframework.social.bitbucket.connect.BitBucketConnectionFactory;
import org.springframework.social.bitbucket.security.BitBucketAuthenticationService;... | package org.springframework.social.bitbucket.config.annotation;
/**
* {@link ImportBeanDefinitionRegistrar} for configuring a
* {@link TwitterConnectionFactory} bean and a request-scoped {@link Twitter}
* bean.
*
* @author Craig Walls
*/
public class TwitterProviderConfigRegistrar extends
AbstractProvi... | // Path: src/main/java/org/springframework/social/bitbucket/config/support/BitBucketApiHelper.java
// public class BitBucketApiHelper implements ApiHelper<BitBucket> {
// private final UsersConnectionRepository usersConnectionRepository;
//
// private final UserIdSource userIdSource;
//
// private BitBuck... | return BitBucketAuthenticationService.class; |
Graylog2/gelfclient | src/main/java/org/graylog2/gelfclient/transport/GelfSenderThread.java | // Path: src/main/java/org/graylog2/gelfclient/GelfMessage.java
// public class GelfMessage {
// private final GelfMessageVersion version;
// private final String host;
// private final String message;
// private String fullMessage;
// private double timestamp = System.currentTimeMillis() / 1000D;
/... | import static java.util.concurrent.TimeUnit.MICROSECONDS;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import org.graylog2.gelfclient.GelfMessage;
import org.graylog2.gelfclient.util.Uninterruptibles;
import org.slf4j.Logger;
import org.slf4j.Log... | /*
* Copyright 2014 TORCH GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... | // Path: src/main/java/org/graylog2/gelfclient/GelfMessage.java
// public class GelfMessage {
// private final GelfMessageVersion version;
// private final String host;
// private final String message;
// private String fullMessage;
// private double timestamp = System.currentTimeMillis() / 1000D;
/... | private final BlockingQueue<GelfMessage> queue; |
Graylog2/gelfclient | src/main/java/org/graylog2/gelfclient/transport/GelfSenderThread.java | // Path: src/main/java/org/graylog2/gelfclient/GelfMessage.java
// public class GelfMessage {
// private final GelfMessageVersion version;
// private final String host;
// private final String message;
// private String fullMessage;
// private double timestamp = System.currentTimeMillis() / 1000D;
/... | import static java.util.concurrent.TimeUnit.MICROSECONDS;
import io.netty.channel.Channel;
import io.netty.channel.ChannelFuture;
import io.netty.channel.ChannelFutureListener;
import org.graylog2.gelfclient.GelfMessage;
import org.graylog2.gelfclient.util.Uninterruptibles;
import org.slf4j.Logger;
import org.slf4j.Log... | }
};
while (keepRunning.get()) {
// wait until we are connected to the graylog2 server before polling log events from the queue
lock.lock();
try {
while (channel == null || !channel.i... | // Path: src/main/java/org/graylog2/gelfclient/GelfMessage.java
// public class GelfMessage {
// private final GelfMessageVersion version;
// private final String host;
// private final String message;
// private String fullMessage;
// private double timestamp = System.currentTimeMillis() / 1000D;
/... | Uninterruptibles.sleepUninterruptibly(1, MICROSECONDS); |
Graylog2/gelfclient | src/test/java/org/graylog2/gelfclient/Issue22.java | // Path: src/main/java/org/graylog2/gelfclient/transport/GelfTransport.java
// public interface GelfTransport {
// /**
// * Sends the given message to the remote host. This <strong>blocks</strong> until there is sufficient capacity to
// * process the message. It is not guaranteed that the message has bee... | import org.graylog2.gelfclient.transport.GelfTransport;
import org.testng.annotations.Test;
import java.net.InetSocketAddress;
import java.util.Date; | /*
* Copyright 2016 TORCH GmbH
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... | // Path: src/main/java/org/graylog2/gelfclient/transport/GelfTransport.java
// public interface GelfTransport {
// /**
// * Sends the given message to the remote host. This <strong>blocks</strong> until there is sufficient capacity to
// * process the message. It is not guaranteed that the message has bee... | final GelfTransport transport = GelfTransports.create(config); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/economy/Economy.java | // Path: src/main/java/edu/self/startux/craftBay/CraftBayPlugin.java
// public final class CraftBayPlugin extends JavaPlugin {
// private String tag = "[CraftBay]";
// private ChatPlugin chatPlugin;
// private AuctionAnnouncer announcer;
// private AuctionHouse house;
// @Getter private AuctionSched... | import edu.self.startux.craftBay.CraftBayPlugin;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer; | package edu.self.startux.craftBay.economy;
public interface Economy {
Economy setup();
boolean has(OfflinePlayer off, double money);
double get(OfflinePlayer off);
boolean give(OfflinePlayer off, double money, String message);
boolean take(OfflinePlayer off, double money, String message);
Stri... | // Path: src/main/java/edu/self/startux/craftBay/CraftBayPlugin.java
// public final class CraftBayPlugin extends JavaPlugin {
// private String tag = "[CraftBay]";
// private ChatPlugin chatPlugin;
// private AuctionAnnouncer announcer;
// private AuctionHouse house;
// @Getter private AuctionSched... | static Economy get(CraftBayPlugin plugin) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionStartEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import edu.self.startux.craftBay.Auction;
import org.bukkit.event.HandlerList; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | public AuctionStartEvent(Auction auction) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/TimedAuction.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.... | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | AuctionStartEvent event = new AuctionStartEvent(this); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/TimedAuction.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.... | AuctionStartEvent event = new AuctionStartEvent(this);
getPlugin().getServer().getPluginManager().callEvent(event);
}
@Override
public int getTimeLeft() {
return timeLeft;
}
@Override
public void setTimeLeft(int time) {
timeLeft = time;
}
@Override
... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | getPlugin().getServer().getPluginManager().callEvent(new AuctionTickEvent(this)); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/TimedAuction.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay.event.AuctionTickEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.ListIterator;
import java.... | bids.addLast(bid);
}
@Override
public boolean bid(Merchant bidder, MoneyAmount bid) {
if (getState() != AuctionState.RUNNING) return false;
if (bidder.equals(getOwner()) && !bidder.equals(BankMerchant.getInstance())) {
bidder.warn(getPlugin().getMessage("auction.bid.IsOw... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | AuctionBidEvent event = new AuctionBidEvent(this, bidder, bid, oldWinner, oldPrice); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import edu.self.startux.craftBay.Auction;
import org.bukkit.event.HandlerList; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | public AuctionCreateEvent(Auction auction) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionTimeChangeEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import edu.self.startux.craftBay.Auction;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | public AuctionTimeChangeEvent(Auction auction, CommandSender sender, int delay) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/AuctionHouse.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java
// public class AuctionCreateEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
//
// public AuctionCreateEvent(Auction auction) {
// super(auction);
// }
//
// ... | import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import java.util.Date;
import java.util.HashMap;
import java.util.Map; | }
if (!plugin.getAuctionScheduler().canQueue()) {
owner.warn(plugin.getMessage("auction.create.QueueFull").set(owner));
return null;
}
double fee = 0.0;
double tax = 0.0;
if (!owner.hasPermission("auction.nofee")) fee = plugin.getConfig().getDouble... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java
// public class AuctionCreateEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
//
// public AuctionCreateEvent(Auction auction) {
// super(auction);
// }
//
// ... | plugin.getServer().getPluginManager().callEvent(new AuctionCreateEvent(auction)); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/AuctionHouse.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java
// public class AuctionCreateEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
//
// public AuctionCreateEvent(Auction auction) {
// super(auction);
// }
//
// ... | import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import java.util.Date;
import java.util.HashMap;
import java.util.Map; | double fee = 0.0;
double tax = 0.0;
if (!owner.hasPermission("auction.nofee")) fee = plugin.getConfig().getDouble("auctionfee");
if (!owner.hasPermission("auction.notax") && startingBid.getDouble() > plugin.getConfig().getDouble("startingbid")) {
tax = (plugin.getConfig().get... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionCreateEvent.java
// public class AuctionCreateEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
//
// public AuctionCreateEvent(Auction auction) {
// super(auction);
// }
//
// ... | AuctionEndEvent event = new AuctionEndEvent(auction); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/economy/VaultEconomy.java | // Path: src/main/java/edu/self/startux/craftBay/CraftBayPlugin.java
// public final class CraftBayPlugin extends JavaPlugin {
// private String tag = "[CraftBay]";
// private ChatPlugin chatPlugin;
// private AuctionAnnouncer announcer;
// private AuctionHouse house;
// @Getter private AuctionSched... | import edu.self.startux.craftBay.CraftBayPlugin;
import lombok.RequiredArgsConstructor;
import org.bukkit.Bukkit;
import org.bukkit.OfflinePlayer;
import org.bukkit.plugin.RegisteredServiceProvider; | package edu.self.startux.craftBay.economy;
@RequiredArgsConstructor
public final class VaultEconomy implements Economy { | // Path: src/main/java/edu/self/startux/craftBay/CraftBayPlugin.java
// public final class CraftBayPlugin extends JavaPlugin {
// private String tag = "[CraftBay]";
// private ChatPlugin chatPlugin;
// private AuctionAnnouncer announcer;
// private AuctionHouse house;
// @Getter private AuctionSched... | private final CraftBayPlugin plugin; |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/AuctionLogger.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionCancelEvent;
import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay... | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | public void onAuctionCreate(AuctionCreateEvent event) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/AuctionLogger.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionCancelEvent;
import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay... | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | public void onAuctionStart(AuctionStartEvent event) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/AuctionLogger.java | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | import edu.self.startux.craftBay.event.AuctionBidEvent;
import edu.self.startux.craftBay.event.AuctionCancelEvent;
import edu.self.startux.craftBay.event.AuctionCreateEvent;
import edu.self.startux.craftBay.event.AuctionEndEvent;
import edu.self.startux.craftBay.event.AuctionStartEvent;
import edu.self.startux.craftBay... | public void enable() {
plugin.getServer().getPluginManager().registerEvents(this, plugin);
}
@EventHandler(priority = EventPriority.LOWEST)
public void onAuctionCreate(AuctionCreateEvent event) {
if (!plugin.getDebugMode()) return;
Auction... | // Path: src/main/java/edu/self/startux/craftBay/event/AuctionBidEvent.java
// public class AuctionBidEvent extends AuctionEvent {
// private static HandlerList handlers = new HandlerList();
// private Merchant bidder, oldWinner;
// private MoneyAmount amount, oldPrice;
//
// public Auc... | public void onAuctionCancel(AuctionCancelEvent event) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/RealItem.java | // Path: src/main/java/edu/self/startux/craftBay/item/ItemManager.java
// public interface ItemManager {
// /**
// * Does this manager manage this item exclusively?
// */
// boolean isManaged(ItemStack itemStack);
//
// /**
// * Produce the item display name.
// */
// Component getD... | import edu.self.startux.craftBay.item.ItemManager;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.... | PotionData data = potions.getBasePotionData();
if (data != null && data.getType() != PotionType.UNCRAFTABLE) {
sb.append(" ");
sb.append(niceEnumName(data.getType().name()));
if (data.isExtended()) sb.append(" Ext");
... | // Path: src/main/java/edu/self/startux/craftBay/item/ItemManager.java
// public interface ItemManager {
// /**
// * Does this manager manage this item exclusively?
// */
// boolean isManaged(ItemStack itemStack);
//
// /**
// * Produce the item display name.
// */
// Component getD... | for (ItemManager itemManager : CraftBayPlugin.getInstance().getItemManagers()) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/AuctionInventory.java | // Path: src/main/java/edu/self/startux/craftBay/locale/Color.java
// public final class Color {
// public static final Color DEFAULT = new Color(new String[]{"DEFAULT", "DFL"}, NamedTextColor.BLUE);
// public static final Color HEADER = new Color(new String[]{"HEADER", "HEAD", "HD", "H"}, NamedTextColor.YELLOW... | import edu.self.startux.craftBay.locale.Color;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import net.kyori.adventure.text.Component;
import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Sound;
import org.bukkit.SoundCatego... | data.minbid = minbid;
data.inventory = inventory;
data.type = type;
}
}
public void initPlayer(Player player, MoneyAmount minbid) {
String title = plugin.getMessage("auction.gui.ChestTitle").toString();
if (title.length() > 32) title = title.substring... | // Path: src/main/java/edu/self/startux/craftBay/locale/Color.java
// public final class Color {
// public static final Color DEFAULT = new Color(new String[]{"DEFAULT", "DFL"}, NamedTextColor.BLUE);
// public static final Color HEADER = new Color(new String[]{"HEADER", "HEAD", "HD", "H"}, NamedTextColor.YELLOW... | Component name = Component.text("Auction Preview", Color.DEFAULT.getTextColor()); |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/economy/MoneyEconomy.java | // Path: src/main/java/edu/self/startux/craftBay/CraftBayPlugin.java
// public final class CraftBayPlugin extends JavaPlugin {
// private String tag = "[CraftBay]";
// private ChatPlugin chatPlugin;
// private AuctionAnnouncer announcer;
// private AuctionHouse house;
// @Getter private AuctionSched... | import com.cavetale.money.Money;
import edu.self.startux.craftBay.CraftBayPlugin;
import lombok.RequiredArgsConstructor;
import org.bukkit.OfflinePlayer; | package edu.self.startux.craftBay.economy;
@RequiredArgsConstructor
public final class MoneyEconomy implements Economy { | // Path: src/main/java/edu/self/startux/craftBay/CraftBayPlugin.java
// public final class CraftBayPlugin extends JavaPlugin {
// private String tag = "[CraftBay]";
// private ChatPlugin chatPlugin;
// private AuctionAnnouncer announcer;
// private AuctionHouse house;
// @Getter private AuctionSched... | private final CraftBayPlugin plugin; |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionEndEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import edu.self.startux.craftBay.Auction;
import org.bukkit.event.HandlerList; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | public AuctionEndEvent(Auction auction) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionCancelEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import edu.self.startux.craftBay.Auction;
import org.bukkit.command.CommandSender;
import org.bukkit.event.HandlerList; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | public AuctionCancelEvent(Auction auction, CommandSender sender) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionTickEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import edu.self.startux.craftBay.Auction;
import org.bukkit.event.HandlerList; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | public AuctionTickEvent(Auction auction) { |
StarTux/CraftBay | src/main/java/edu/self/startux/craftBay/event/AuctionEvent.java | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | import org.bukkit.event.Event;
import org.bukkit.event.HandlerList;
import edu.self.startux.craftBay.Auction; | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright 2012 StarTux
*
* This file is part of CraftBay.
*
* CraftBay is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, ei... | // Path: src/main/java/edu/self/startux/craftBay/Auction.java
// public interface Auction extends ConfigurationSerializable {
// /**
// * Get this auction's id
// * @return the id
// */
// public int getId();
//
// /**
// * The AuctionScheduler should set the... | private Auction auction; |
cpiotr/blog | blog-code/src/test/java/pl/ciruk/blog/fanout/CompletableFuturesTest.java | // Path: blog-code/src/main/java/pl/ciruk/blog/fanout/CompletableFutures.java
// static <F, T> Function<F, CompletableFuture<Stream<T>>> fanOut(Collection<Function<F, T>> mappings) {
// return fanOut(mappings, ForkJoinPool.commonPool());
// }
| import com.google.common.collect.ImmutableList;
import org.junit.Test;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.stream.Stream;
im... | package pl.ciruk.blog.fanout;
public class CompletableFuturesTest {
@Test
public void shouldExecuteAllFunctionsFromMappings() throws Exception {
// Given
CompletableFuture<String> future = CompletableFuture.completedFuture("SampleText");
// When
CompletableFuture<Stream<Integer>> actualFuture = future.th... | // Path: blog-code/src/main/java/pl/ciruk/blog/fanout/CompletableFutures.java
// static <F, T> Function<F, CompletableFuture<Stream<T>>> fanOut(Collection<Function<F, T>> mappings) {
// return fanOut(mappings, ForkJoinPool.commonPool());
// }
// Path: blog-code/src/test/java/pl/ciruk/blog/fanout/CompletableFuturesTe... | fanOut(ImmutableList.of( |
cpiotr/blog | blog-code/src/main/java/pl/ciruk/blog/producerconsumer/web/PagesProcessor.java | // Path: blog-code/src/main/java/pl/ciruk/blog/producerconsumer/concurrent/Consumer.java
// public class Consumer<T extends Queueable> implements Runnable {
// private BlockingQueue<T> queue;
//
// private Processable<T> processor;
//
// public Consumer(BlockingQueue<T> queue) {
// this(queue, Processable.EMPT... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import pl.ciruk.blog.producerconsum... | package pl.ciruk.blog.producerconsumer.web;
public class PagesProcessor {
Map<String, Producer<Page>> producers = new HashMap<>();
ExecutorService executor = Executors.newFixedThreadPool(4);
public void createProducer(final String producerId) {
BlockingQueue<Page> queue = new LinkedBlockingQueue<Page>();
... | // Path: blog-code/src/main/java/pl/ciruk/blog/producerconsumer/concurrent/Consumer.java
// public class Consumer<T extends Queueable> implements Runnable {
// private BlockingQueue<T> queue;
//
// private Processable<T> processor;
//
// public Consumer(BlockingQueue<T> queue) {
// this(queue, Processable.EMPT... | Consumer<Page> consumer = new Consumer<>(queue, new Processable<Page>() { |
cpiotr/blog | blog-code/src/main/java/pl/ciruk/blog/producerconsumer/web/PagesProcessor.java | // Path: blog-code/src/main/java/pl/ciruk/blog/producerconsumer/concurrent/Consumer.java
// public class Consumer<T extends Queueable> implements Runnable {
// private BlockingQueue<T> queue;
//
// private Processable<T> processor;
//
// public Consumer(BlockingQueue<T> queue) {
// this(queue, Processable.EMPT... | import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.TimeUnit;
import pl.ciruk.blog.producerconsum... | package pl.ciruk.blog.producerconsumer.web;
public class PagesProcessor {
Map<String, Producer<Page>> producers = new HashMap<>();
ExecutorService executor = Executors.newFixedThreadPool(4);
public void createProducer(final String producerId) {
BlockingQueue<Page> queue = new LinkedBlockingQueue<Page>();
... | // Path: blog-code/src/main/java/pl/ciruk/blog/producerconsumer/concurrent/Consumer.java
// public class Consumer<T extends Queueable> implements Runnable {
// private BlockingQueue<T> queue;
//
// private Processable<T> processor;
//
// public Consumer(BlockingQueue<T> queue) {
// this(queue, Processable.EMPT... | Consumer<Page> consumer = new Consumer<>(queue, new Processable<Page>() { |
cpiotr/blog | blog-code/src/test/java/pl/ciruk/blog/jms/MockDestinationIntegrationTest.java | // Path: blog-code/src/main/java/pl/ciruk/blog/mq/MQConfiguration.java
// @Configuration
// @EnableJms
// public class MQConfiguration {
// @Bean
// public PlatformTransactionManager platformTransactionManager(ConnectionFactory connectionFactory) {
// return new JmsTransactionManager(connectionFactory);... | import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springfr... |
@Test
public void shouldPrintTwoReceivedMessagesAndRespondToOne() throws Exception {
mockDestination
.whenReceived(message -> message.equals(FIRST_MESSAGE))
.thenSend(RESPONSE_QUEUE, message -> message + " acknowledged");
mockDestination
.whenRece... | // Path: blog-code/src/main/java/pl/ciruk/blog/mq/MQConfiguration.java
// @Configuration
// @EnableJms
// public class MQConfiguration {
// @Bean
// public PlatformTransactionManager platformTransactionManager(ConnectionFactory connectionFactory) {
// return new JmsTransactionManager(connectionFactory);... | static class TestConfiguration extends MQConfiguration { |
cpiotr/blog | blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/SampleEntityTest.java | // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static pl.ciruk.blog.jpa_unit_tests.CollectionMatchers.isInCollection;
im... | package pl.ciruk.blog.jpa_unit_tests;
public class SampleEntityTest {
@Inject
private EntityManager entityManager;
@Inject
| // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | private MyJpaInitializer jpaInitializer;
|
cpiotr/blog | blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/SampleEntityTest.java | // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static pl.ciruk.blog.jpa_unit_tests.CollectionMatchers.isInCollection;
im... | package pl.ciruk.blog.jpa_unit_tests;
public class SampleEntityTest {
@Inject
private EntityManager entityManager;
@Inject
private MyJpaInitializer jpaInitializer;
@Before
public void setUp() {
| // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | Guice.createInjector(new MyGuiceModule()).injectMembers(this);
|
cpiotr/blog | blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/SampleEntityTest.java | // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static pl.ciruk.blog.jpa_unit_tests.CollectionMatchers.isInCollection;
im... | @After
public void cleanUp() {
entityManager.getTransaction().rollback();
jpaInitializer.stopService();
}
@Test
public void shouldRetrieveEntitiesWithAmountBelowThreshold() {
int numberOfMockEntities = 100;
List<SampleEntity> mockEntities = Entities.mockListOf(SampleEntity.class, numberOfMockEnt... | // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | everyItem(isInCollection(mockEntities)),
|
cpiotr/blog | blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/SampleEntityTest.java | // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | import static org.hamcrest.CoreMatchers.allOf;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.everyItem;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static pl.ciruk.blog.jpa_unit_tests.CollectionMatchers.isInCollection;
im... | public void cleanUp() {
entityManager.getTransaction().rollback();
jpaInitializer.stopService();
}
@Test
public void shouldRetrieveEntitiesWithAmountBelowThreshold() {
int numberOfMockEntities = 100;
List<SampleEntity> mockEntities = Entities.mockListOf(SampleEntity.class, numberOfMockEntities);
... | // Path: blog-code/src/test/java/pl/ciruk/blog/jpa_unit_tests/CollectionMatchers.java
// public static <T> Matcher<T> isInCollection(Collection<T> collection) {
// return new TypeSafeMatcher<T>() {
//
// @Override
// public void describeTo(Description description) {
// description.appendText("in collection: ")... | everyItem(hasAmountLowerThan(amountThreshold))
|
liying2008/neu-ipgw | app/src/main/java/lxy/liying/ipgw/post/ConnectPC.java | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.RequestMethod;
import com.yanzhenjie.nohttp.rest.Request;
import com.yanzhenjie.nohttp.rest.Response;
import java.net.UnknownHostException;
import lxy.liying.ipgw.url.IPGWUrl;
| package lxy.liying.ipgw.post;
/**
* 连接网络
*
* @author 李颖
*/
class ConnectPC {
private static Request<String> mRequest;
/**
* 静态方法,连接网络
*
* @param uid 用户名
* @param password 密码
* @return 成功:Post结果,网页源代码。 失败:"提交数据失败"
*/
static String connectPC(St... | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | mRequest = NoHttp.createStringRequest(IPGWUrl.PC_POST_CONNECT_URL, RequestMethod.POST);
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/widget/IpgwWidgetProvider.java | // Path: app/src/main/java/com/liying/ipgw/utils/Constants.java
// public interface Constants {
// String INSIDE_CHINA = "2";
// /** Activity传递的Intent数据的key */
// String PROGRAM = "program";
// /** Sharedpreferences的名字 */
// String PREFS_NAME = "spc";
// /** 存储彩蛋信息的Sharedpreferences的名字 */
... | import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.Context;
import android.content.Intent;
import com.liying.ipgw.utils.Constants;
import com.umeng.analytics.MobclickAgent;
| package com.liying.ipgw.widget;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2016/11/6 15:56
* 版本:1.0
* 描述:
* 备注:
* =======================================================
*/
public class IpgwWidgetProvider extends AppWidgetProvider {
... | // Path: app/src/main/java/com/liying/ipgw/utils/Constants.java
// public interface Constants {
// String INSIDE_CHINA = "2";
// /** Activity传递的Intent数据的key */
// String PROGRAM = "program";
// /** Sharedpreferences的名字 */
// String PREFS_NAME = "spc";
// /** 存储彩蛋信息的Sharedpreferences的名字 */
... | MobclickAgent.onEvent(context, Constants.UmengStatistics.IPGW_TOOL);
|
liying2008/neu-ipgw | app/src/main/java/lxy/liying/ipgw/post/Connect.java | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.RequestMethod;
import com.yanzhenjie.nohttp.rest.Request;
import com.yanzhenjie.nohttp.rest.Response;
import java.net.UnknownHostException;
import lxy.liying.ipgw.url.IPGWUrl;
| package lxy.liying.ipgw.post;
/**
* 连接网络
*
* @author 李颖
*/
class Connect {
private static Request<String> mRequest;
/**
* 静态方法,连接网络
*
* @param uid 用户名
* @param password 密码
* @return 成功:Post结果,网页源代码。 失败:"提交数据失败"
*/
static String connect(String... | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | mRequest = NoHttp.createStringRequest(IPGWUrl.POST_CONNECT_URL, RequestMethod.POST);
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/db/DBInfo.java | // Path: app/src/main/java/com/liying/ipgw/model/AccountInfo.java
// public class AccountInfo {
//
// private String userName = null;
// private String psw = null;
// private String range = "2";
//
// public static final String USERNAME = "userName";
// public static final String PSW = "psw";
// pu... | import com.liying.ipgw.model.AccountInfo;
import com.liying.ipgw.model.Express;
| package com.liying.ipgw.db;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2015/12/06 12:29
* 版本:1.0
* 描述:数据库常量信息
* 备注:
* =======================================================
*/
class DBInfo {
/**
* 数据库名称
*/
public sta... | // Path: app/src/main/java/com/liying/ipgw/model/AccountInfo.java
// public class AccountInfo {
//
// private String userName = null;
// private String psw = null;
// private String range = "2";
//
// public static final String USERNAME = "userName";
// public static final String PSW = "psw";
// pu... | public static final String EXPRESS_TB_NAME = "Express";
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/db/DBInfo.java | // Path: app/src/main/java/com/liying/ipgw/model/AccountInfo.java
// public class AccountInfo {
//
// private String userName = null;
// private String psw = null;
// private String range = "2";
//
// public static final String USERNAME = "userName";
// public static final String PSW = "psw";
// pu... | import com.liying.ipgw.model.AccountInfo;
import com.liying.ipgw.model.Express;
| package com.liying.ipgw.db;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2015/12/06 12:29
* 版本:1.0
* 描述:数据库常量信息
* 备注:
* =======================================================
*/
class DBInfo {
/**
* 数据库名称
*/
public sta... | // Path: app/src/main/java/com/liying/ipgw/model/AccountInfo.java
// public class AccountInfo {
//
// private String userName = null;
// private String psw = null;
// private String range = "2";
//
// public static final String USERNAME = "userName";
// public static final String PSW = "psw";
// pu... | AccountInfo.USERNAME + " varchar(20), " +
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/adapter/ColorThemeListAdapter.java | // Path: app/src/main/java/com/liying/ipgw/model/ColorTheme.java
// public class ColorTheme {
// /** 主题位置 */
// private int position;
// /** 主题名称 */
// private String themeName;
// /** 预览图片的Drawable id */
// private int themePreId;
// /** 是否选中 */
// private boolean isSelected;
/... | import android.content.Context;
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.LinearLayout;
import android.widget.TextView;
import com.liying.ipgw.R;
import com.l... | package com.liying.ipgw.adapter;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2016/11/4 19:58
* 版本:1.0
* 描述:色彩主题列表适配器
* 备注:
* =======================================================
*/
public class ColorThemeListAdapter extends RecyclerVie... | // Path: app/src/main/java/com/liying/ipgw/model/ColorTheme.java
// public class ColorTheme {
// /** 主题位置 */
// private int position;
// /** 主题名称 */
// private String themeName;
// /** 预览图片的Drawable id */
// private int themePreId;
// /** 是否选中 */
// private boolean isSelected;
/... | private ColorTheme[] colorThemes;
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/adapter/RecommendListAdapter.java | // Path: app/src/main/java/com/liying/ipgw/activity/RecommendActivity.java
// public class RecommendActivity extends BaseActivity {
// private static WeakReference<RecommendActivity> recommendActivity;
//
// // 图标数组
// private static int[] icons = {R.mipmap.xdp_512x512, R.mipmap.sec_512x512, R.mipmap.c... | import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import com.liying.ipgw.R;
import com.liying.ipgw.activit... |
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
ListItemView listItemView = null;
if (convertView == null){
listItemView = new ListItemView();
... | // Path: app/src/main/java/com/liying/ipgw/activity/RecommendActivity.java
// public class RecommendActivity extends BaseActivity {
// private static WeakReference<RecommendActivity> recommendActivity;
//
// // 图标数组
// private static int[] icons = {R.mipmap.xdp_512x512, R.mipmap.sec_512x512, R.mipmap.c... | RecommendActivity activity = RecommendActivity.getInstance();
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/adapter/TraceListAdapter.java | // Path: app/src/main/java/com/liying/ipgw/model/Trace.java
// public class Trace {
// /** 时间 */
// private String acceptTime;
// /** 描述 */
// private String acceptStation;
// /** 备注 */
// private String remark;
//
// public Trace() {
// }
//
// public Trace(String accep... | import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
import com.liying.ipgw.R;
import com.liying.ipgw.model.Trace;
import java.util.ArrayList;
import java.util.List;
| package com.liying.ipgw.adapter;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2016/11/22 20:53
* 版本:1.0
* 描述:物流信息列表适配器
* 备注:
* =======================================================
*/
public class TraceListAdapter extends BaseAdapter {... | // Path: app/src/main/java/com/liying/ipgw/model/Trace.java
// public class Trace {
// /** 时间 */
// private String acceptTime;
// /** 描述 */
// private String acceptStation;
// /** 备注 */
// private String remark;
//
// public Trace() {
// }
//
// public Trace(String accep... | private List<Trace> traceList = new ArrayList<>(1);
|
liying2008/neu-ipgw | app/src/main/java/lxy/liying/ipgw/info/GetConnInfo.java | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.RequestMethod;
import com.yanzhenjie.nohttp.rest.Request;
import com.yanzhenjie.nohttp.rest.Response;
import java.util.Locale;
import lxy.liying.ipgw.url.IPGWUrl; | package lxy.liying.ipgw.info;
/**
* 得到在线信息类
*/
public class GetConnInfo {
/**
* 得到连接用户的信息 例如: <br />
* 45223109,12623,45.00,,0,58.154.209.141 <br />
* 45278986,13189,45.00,,0,58.154.209.141 <br />
* 流量,时长,余额,,0,IP地址
*
* @return
*/
private static String getConnInfoHtml() {
// 创建请求 | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | Request<String> request = NoHttp.createStringRequest(IPGWUrl.POST_DETAILS, RequestMethod.POST); |
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/db/ExpressServices.java | // Path: app/src/main/java/com/liying/ipgw/model/Express.java
// public class Express {
// /** 时间戳 */
// private long time;
// /** 快递单号 */
// private String expressCode;
// /** 快递公司公司 */
// private String shipperName;
// /** 快递公司编码 */
// private String shipperCode;
// /** 备注... | import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.liying.ipgw.model.Express;
import java.util.ArrayList;
import java.util.List;
| package com.liying.ipgw.db;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2015/12/06 12:34
* 版本:1.0
* 描述:快递单信息存取操作
* 备注:
* =======================================================
*/
public class ExpressServices extends BaseDbService {
... | // Path: app/src/main/java/com/liying/ipgw/model/Express.java
// public class Express {
// /** 时间戳 */
// private long time;
// /** 快递单号 */
// private String expressCode;
// /** 快递公司公司 */
// private String shipperName;
// /** 快递公司编码 */
// private String shipperCode;
// /** 备注... | private String[] columns = {Express.TIME, Express.EXPRESS_CODE, Express.SHIPPER_NAME, Express.SHIPPER_CODE, Express.MARK};
|
liying2008/neu-ipgw | app/src/main/java/lxy/liying/ipgw/post/DisconnectAll.java | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.RequestMethod;
import com.yanzhenjie.nohttp.rest.Request;
import com.yanzhenjie.nohttp.rest.Response;
import java.net.UnknownHostException;
import lxy.liying.ipgw.url.IPGWUrl;
| package lxy.liying.ipgw.post;
/**
* 断开全部连接
*
* @author 李颖
*/
class DisconnectAll {
private static Request<String> mRequest;
/**
* 静态方法,断开网络
*
* @param username 用户名
* @param password 密码
* @return 成功:Post结果,网页源代码。 失败:"提交数据失败"
*/
static String discon... | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | mRequest = NoHttp.createStringRequest(IPGWUrl.POST_DISCONNECTALL_URL, RequestMethod.POST);
|
liying2008/neu-ipgw | app/src/main/java/lxy/liying/ipgw/post/Disconnect.java | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.RequestMethod;
import com.yanzhenjie.nohttp.rest.Request;
import com.yanzhenjie.nohttp.rest.Response;
import java.net.UnknownHostException;
import lxy.liying.ipgw.url.IPGWUrl;
| package lxy.liying.ipgw.post;
/**
* 断开网络
*
* @author 李颖
*/
class Disconnect {
private static Request<String> mRequest;
/**
* 静态方法,断开网络
*
* @param ip 用户连接的IP地址
* @return 成功:Post结果,网页源代码。 失败:"提交数据失败"
*/
static String disconnect(String ip) throws Unknown... | // Path: app/src/main/java/lxy/liying/ipgw/url/IPGWUrl.java
// public class IPGWUrl {
// /** 连接网络的POST地址 */
// public static String POST_CONNECT_URL = "";
// /** 主机端连接网络的POST地址 */
// public static String PC_POST_CONNECT_URL = "";
// /** 断开网络的POST地址 */
// public static String POST_DISCONNECT_URL = "";
// /** 断开全部... | mRequest = NoHttp.createStringRequest(IPGWUrl.POST_DISCONNECT_URL, RequestMethod.POST);
|
liying2008/neu-ipgw | app/src/main/java/com/liying/ipgw/db/AccountInfoServices.java | // Path: app/src/main/java/com/liying/ipgw/model/AccountInfo.java
// public class AccountInfo {
//
// private String userName = null;
// private String psw = null;
// private String range = "2";
//
// public static final String USERNAME = "userName";
// public static final String PSW = "psw";
// pu... | import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import com.liying.ipgw.model.AccountInfo;
import java.util.ArrayList;
import java.util.List;
| package com.liying.ipgw.db;
/**
* =======================================================
* 作者:liying - liruoer2008@yeah.net
* 日期:2015/12/06 12:34
* 版本:1.0
* 描述:数据库操作层
* 备注:
* =======================================================
*/
public class AccountInfoServices extends BaseDbService {
... | // Path: app/src/main/java/com/liying/ipgw/model/AccountInfo.java
// public class AccountInfo {
//
// private String userName = null;
// private String psw = null;
// private String range = "2";
//
// public static final String USERNAME = "userName";
// public static final String PSW = "psw";
// pu... | private String[] columns = {AccountInfo.USERNAME, AccountInfo.PSW, AccountInfo.RANGE};
|
amanvishnani/8085 | src/main/java/com/amanvishnani/sim8085/domain/Impl/Compiler.java | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | import com.amanvishnani.sim8085.domain.IAddress;
import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IOpcode;
import java.util.*; | package com.amanvishnani.sim8085.domain.Impl;
public class Compiler {
private final Parser parser;
Map<Integer, InstructionRow> instructionRowMap;
Map<String, Integer> labelMap;
public Compiler(Parser parser) {
this.parser = parser;
this.resetParams();
}
public Compiler() {... | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | IOpcode opcode = parser.getOpcode(lineInstruction); |
amanvishnani/8085 | src/main/java/com/amanvishnani/sim8085/domain/Impl/Compiler.java | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | import com.amanvishnani.sim8085.domain.IAddress;
import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IOpcode;
import java.util.*; |
private void resetParams() {
instructionRowMap = new HashMap<>();
labelMap = new HashMap<>();
}
private void passOne(List<String> instructions) {
int localPointer = 0;
for (String lineInstruction :
instructions) {
// Get Opcode
IOpco... | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | IData data = parser.extractData(lineInstruction); |
amanvishnani/8085 | src/main/java/com/amanvishnani/sim8085/domain/Impl/Compiler.java | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | import com.amanvishnani.sim8085.domain.IAddress;
import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IOpcode;
import java.util.*; | for (String lineInstruction :
instructions) {
// Get Opcode
IOpcode opcode = parser.getOpcode(lineInstruction);
// extract label
String label = parser.extractLabel(lineInstruction);
if(!label.isEmpty()) {
labelMap.put(... | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | IAddress address = parser.extractOperandAddress(opcode.getInstruction()); |
amanvishnani/8085 | src/main/java/com/amanvishnani/sim8085/domain/Impl/MemorySlice.java | // Path: src/main/java/com/amanvishnani/sim8085/domain/IMemory.java
// public interface IMemory {
// IData getData(Integer intAddress);
// IAddress getAddress(Integer intAddress);
// String getHexData(Integer intAddress);
// String getHexData(String hexAddress);
// void setData(String hexAddress, St... | import com.amanvishnani.sim8085.domain.IMemorySlice;
import com.amanvishnani.sim8085.domain.IMemory; | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.amanvishnani.sim8085.domain.Impl;
/**
*
* @author Aman Vishnani
*/
public class MemorySlice implements IMemorySlice {
... | // Path: src/main/java/com/amanvishnani/sim8085/domain/IMemory.java
// public interface IMemory {
// IData getData(Integer intAddress);
// IAddress getAddress(Integer intAddress);
// String getHexData(Integer intAddress);
// String getHexData(String hexAddress);
// void setData(String hexAddress, St... | IMemory memoryRef; |
amanvishnani/8085 | src/main/java/com/amanvishnani/sim8085/domain/Impl/Memory.java | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IMemory;
import com.amanvishnani.sim8085.domain.IMemorySlice;
import com.amanvishnani.sim8085.domain.IAddress; | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package com.amanvishnani.sim8085.domain.Impl;
/**
*
* @author Aman Vishnani
*/
public class Memory implements IMemory {
public... | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | public IData getData(Integer intAddress) { |
amanvishnani/8085 | src/main/java/com/amanvishnani/sim8085/domain/Impl/Memory.java | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | import com.amanvishnani.sim8085.domain.IData;
import com.amanvishnani.sim8085.domain.IMemory;
import com.amanvishnani.sim8085.domain.IMemorySlice;
import com.amanvishnani.sim8085.domain.IAddress; | IAddress addr = Address.from(hexAddress);
return getHexData(addr.intValue());
}
@Override
public void setData(IAddress address, IData data) {
address.setData(data);
memory[address.intValue()] = address;
}
@Override
public void setData(IAddress address, S... | // Path: src/main/java/com/amanvishnani/sim8085/domain/IAddress.java
// public interface IAddress {
// String hexValue();
// Integer intValue();
// IData getLSB();
// IData getMSB();
// IData getData();
// void setData(IData data);
// static IAddress ZERO = Address.from(0);
// static IAd... | public IMemorySlice getSlice(Integer start, Integer end) { |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.