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
Talon876/RSIRCBot
src/org/nolat/rsircbot/settings/Settings.java
// Path: src/org/nolat/rsircbot/settings/json/BotSettings.java // public class BotSettings { // private String name; // private String server; // private int port; // private boolean debug; // private String broadcast_tag; // private String wit_token; // private int message_count; // pri...
import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; import org.nolat.rsircbot.settings.json.BotSettings; import org.nolat.rsircbot.settings.json.Channel; import org.nolat.rsircbot.settings.json.User; import org.nolat.rsircbot.tools.FileReader; import com.google....
package org.nolat.rsircbot.settings; public class Settings { File settingsFile; String jsonData;
// Path: src/org/nolat/rsircbot/settings/json/BotSettings.java // public class BotSettings { // private String name; // private String server; // private int port; // private boolean debug; // private String broadcast_tag; // private String wit_token; // private int message_count; // pri...
BotSettings settings;
Talon876/RSIRCBot
src/org/nolat/rsircbot/settings/Settings.java
// Path: src/org/nolat/rsircbot/settings/json/BotSettings.java // public class BotSettings { // private String name; // private String server; // private int port; // private boolean debug; // private String broadcast_tag; // private String wit_token; // private int message_count; // pri...
import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.List; import org.nolat.rsircbot.settings.json.BotSettings; import org.nolat.rsircbot.settings.json.Channel; import org.nolat.rsircbot.settings.json.User; import org.nolat.rsircbot.tools.FileReader; import com.google....
package org.nolat.rsircbot.settings; public class Settings { File settingsFile; String jsonData; BotSettings settings; public Settings(String path) throws SettingsException { File f = new File(path); if (f.exists() && f.isFile()) { settingsFile = f; try {
// Path: src/org/nolat/rsircbot/settings/json/BotSettings.java // public class BotSettings { // private String name; // private String server; // private int port; // private boolean debug; // private String broadcast_tag; // private String wit_token; // private int message_count; // pri...
jsonData = FileReader.readFile(path);
Talon876/RSIRCBot
src/org/nolat/rsircbot/data/json/OfferData.java
// Path: src/org/nolat/rsircbot/tools/RSFormatter.java // public class RSFormatter { // public static final DecimalFormat formatter = new DecimalFormat("#,###"); // // public static String format(int num) { // return formatter.format(num); // } // // public static String format(double num) { /...
import java.text.SimpleDateFormat; import java.util.Date; import org.nolat.rsircbot.tools.RSFormatter;
package org.nolat.rsircbot.data.json; public class OfferData { String date; String price; String quantity; String rs_name; String selling; public boolean isSelling() { return selling.equals("1"); } public String getDateString() { Date d = new Date(Long.parseLong(date...
// Path: src/org/nolat/rsircbot/tools/RSFormatter.java // public class RSFormatter { // public static final DecimalFormat formatter = new DecimalFormat("#,###"); // // public static String format(int num) { // return formatter.format(num); // } // // public static String format(double num) { /...
return RSFormatter.format(quantity);
Talon876/RSIRCBot
src/org/nolat/rsircbot/CommandExecutor.java
// Path: src/org/nolat/rsircbot/commands/Command.java // public abstract class Command { // public static ArrayList<Command> commands = new ArrayList<Command>(); // static { // new HelpCommand(); // new HiscoreCommand(); // new CombatCommand(); // new XPForLevelCommand(); // ...
import org.nolat.rsircbot.commands.Command;
package org.nolat.rsircbot; public class CommandExecutor implements Runnable { private final RSIRCBot bot; private final String target; private final String sender; private final String message;
// Path: src/org/nolat/rsircbot/commands/Command.java // public abstract class Command { // public static ArrayList<Command> commands = new ArrayList<Command>(); // static { // new HelpCommand(); // new HiscoreCommand(); // new CombatCommand(); // new XPForLevelCommand(); // ...
private final Command command;
Talon876/RSIRCBot
src/org/nolat/rsircbot/data/BitcoinData.java
// Path: src/org/nolat/rsircbot/tools/URLReader.java // public class URLReader { // // public static String readUrl(String urlString) throws Exception { // BufferedReader reader = null; // StringBuffer buffer = new StringBuffer(); // try { // URL url = new URL(urlString); // ...
import org.nolat.rsircbot.tools.URLReader; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject;
package org.nolat.rsircbot.data; public class BitcoinData { private static final String baseUrl = "http://data.mtgox.com/api/1/BTCUSD/ticker"; private String lowValue = ""; private String highValue = ""; private String avgValue = ""; public BitcoinData() throws LookupException { String ...
// Path: src/org/nolat/rsircbot/tools/URLReader.java // public class URLReader { // // public static String readUrl(String urlString) throws Exception { // BufferedReader reader = null; // StringBuffer buffer = new StringBuffer(); // try { // URL url = new URL(urlString); // ...
jsonData = URLReader.readUrl(baseUrl);
Talon876/RSIRCBot
src/org/nolat/rsircbot/data/json/ItemData.java
// Path: src/org/nolat/rsircbot/tools/RSFormatter.java // public class RSFormatter { // public static final DecimalFormat formatter = new DecimalFormat("#,###"); // // public static String format(int num) { // return formatter.format(num); // } // // public static String format(double num) { /...
import java.util.ArrayList; import java.util.List; import org.nolat.rsircbot.tools.RSFormatter; import org.nolat.rsircbot.tools.TimeUtils;
package org.nolat.rsircbot.data.json; public class ItemData { String average; String high_alch; List<HistoryData> history; String id; String image; String name; List<OfferData> offers; String recent_high; String recent_low; public int getHighAlchValue() { return Integ...
// Path: src/org/nolat/rsircbot/tools/RSFormatter.java // public class RSFormatter { // public static final DecimalFormat formatter = new DecimalFormat("#,###"); // // public static String format(int num) { // return formatter.format(num); // } // // public static String format(double num) { /...
return RSFormatter.format(high_alch);
Talon876/RSIRCBot
src/org/nolat/rsircbot/data/json/ItemData.java
// Path: src/org/nolat/rsircbot/tools/RSFormatter.java // public class RSFormatter { // public static final DecimalFormat formatter = new DecimalFormat("#,###"); // // public static String format(int num) { // return formatter.format(num); // } // // public static String format(double num) { /...
import java.util.ArrayList; import java.util.List; import org.nolat.rsircbot.tools.RSFormatter; import org.nolat.rsircbot.tools.TimeUtils;
return Integer.parseInt(high_alch); } public String getHighAlchString() { return RSFormatter.format(high_alch); } public String getPriceString() { return RSFormatter.format(average); } public int getPriceValue() { return (int) Double.parseDouble(average); }...
// Path: src/org/nolat/rsircbot/tools/RSFormatter.java // public class RSFormatter { // public static final DecimalFormat formatter = new DecimalFormat("#,###"); // // public static String format(int num) { // return formatter.format(num); // } // // public static String format(double num) { /...
if (od.msSincePosted() <= TimeUtils.ONE_HOUR * hours) {
Talon876/RSIRCBot
src/org/nolat/rsircbot/Main.java
// Path: src/org/nolat/rsircbot/settings/Settings.java // public class Settings { // // File settingsFile; // String jsonData; // BotSettings settings; // // public Settings(String path) throws SettingsException { // File f = new File(path); // if (f.exists() && f.isFile()) { // ...
import org.nolat.rsircbot.settings.Settings; import org.nolat.rsircbot.settings.SettingsException; import com.martiansoftware.jsap.FlaggedOption; import com.martiansoftware.jsap.JSAP; import com.martiansoftware.jsap.JSAPException; import com.martiansoftware.jsap.JSAPResult; import com.martiansoftware.jsap.Switch;
package org.nolat.rsircbot; public class Main { public static void main(String[] args) { try { JSAP jsap = new JSAP(); Switch switchOpt = new Switch("help"); switchOpt.setShortFlag('h'); switchOpt.setLongFlag("help"); switchOpt.setHelp("Displ...
// Path: src/org/nolat/rsircbot/settings/Settings.java // public class Settings { // // File settingsFile; // String jsonData; // BotSettings settings; // // public Settings(String path) throws SettingsException { // File f = new File(path); // if (f.exists() && f.isFile()) { // ...
Settings settings = new Settings(filePath);
Talon876/RSIRCBot
src/org/nolat/rsircbot/Main.java
// Path: src/org/nolat/rsircbot/settings/Settings.java // public class Settings { // // File settingsFile; // String jsonData; // BotSettings settings; // // public Settings(String path) throws SettingsException { // File f = new File(path); // if (f.exists() && f.isFile()) { // ...
import org.nolat.rsircbot.settings.Settings; import org.nolat.rsircbot.settings.SettingsException; import com.martiansoftware.jsap.FlaggedOption; import com.martiansoftware.jsap.JSAP; import com.martiansoftware.jsap.JSAPException; import com.martiansoftware.jsap.JSAPResult; import com.martiansoftware.jsap.Switch;
Switch switchOpt = new Switch("help"); switchOpt.setShortFlag('h'); switchOpt.setLongFlag("help"); switchOpt.setHelp("Displays this help message"); jsap.registerParameter(switchOpt); FlaggedOption fileOpt = new FlaggedOption("file"); ...
// Path: src/org/nolat/rsircbot/settings/Settings.java // public class Settings { // // File settingsFile; // String jsonData; // BotSettings settings; // // public Settings(String path) throws SettingsException { // File f = new File(path); // if (f.exists() && f.isFile()) { // ...
} catch (SettingsException e) {
Talon876/RSIRCBot
src/org/nolat/rsircbot/commands/actions/AlchAction.java
// Path: src/org/nolat/rsircbot/data/ItemSearch.java // public class ItemSearch { // private static final String baseUrl = "http://forums.zybez.net/runescape-2007-prices/api/"; // // private String item; // // ItemData[] results; // // public ItemSearch(String item) throws LookupException { // ...
import org.nolat.rsircbot.data.ItemSearch; import org.nolat.rsircbot.data.LookupException; import org.nolat.rsircbot.data.json.ItemData;
package org.nolat.rsircbot.commands.actions; public class AlchAction extends Action { private static ItemSearch NATURE_RUNE; static { try { NATURE_RUNE = new ItemSearch("nature rune");
// Path: src/org/nolat/rsircbot/data/ItemSearch.java // public class ItemSearch { // private static final String baseUrl = "http://forums.zybez.net/runescape-2007-prices/api/"; // // private String item; // // ItemData[] results; // // public ItemSearch(String item) throws LookupException { // ...
} catch (LookupException e) {
Talon876/RSIRCBot
src/org/nolat/rsircbot/commands/actions/AlchAction.java
// Path: src/org/nolat/rsircbot/data/ItemSearch.java // public class ItemSearch { // private static final String baseUrl = "http://forums.zybez.net/runescape-2007-prices/api/"; // // private String item; // // ItemData[] results; // // public ItemSearch(String item) throws LookupException { // ...
import org.nolat.rsircbot.data.ItemSearch; import org.nolat.rsircbot.data.LookupException; import org.nolat.rsircbot.data.json.ItemData;
package org.nolat.rsircbot.commands.actions; public class AlchAction extends Action { private static ItemSearch NATURE_RUNE; static { try { NATURE_RUNE = new ItemSearch("nature rune"); } catch (LookupException e) { e.printStackTrace(); } } public Alch...
// Path: src/org/nolat/rsircbot/data/ItemSearch.java // public class ItemSearch { // private static final String baseUrl = "http://forums.zybez.net/runescape-2007-prices/api/"; // // private String item; // // ItemData[] results; // // public ItemSearch(String item) throws LookupException { // ...
ItemData matchedItem = results.getMatchedItem();
GeoKnow/LinkedGeoData
linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/OsmRepoCoreDaoImpl.java
// Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/core/init/InitJenaLinkedGeoData.java // public class InitJenaLinkedGeoData // implements JenaSubsystemLifecycle // { // private static final Logger logger = LoggerFactory.getLogger(InitJenaLinkedGeoData.class); // // public void start() { // ...
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; import java.net.URI; import java.net.URLConnection; import java.nio.charset.StandardCharsets; import java.time.Instant; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.Abst...
public State getState(long seqId) throws Exception { String path = sequenceIdFormatter.apply(seqId) + ".state.txt"; URI uri = UriBuilder.fromUri(baseUri).path(path).build(); // path("state.txt") State result = getState(uri); return result; } public State getState(URI uri) t...
// Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/core/init/InitJenaLinkedGeoData.java // public class InitJenaLinkedGeoData // implements JenaSubsystemLifecycle // { // private static final Logger logger = LoggerFactory.getLogger(InitJenaLinkedGeoData.class); // // public void start() { // ...
.addProperty(RDF.type, InitJenaLinkedGeoData.State)
GeoKnow/LinkedGeoData
linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/core/init/InitJenaLinkedGeoData.java
// Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/State.java // public interface State // extends Resource // { // Calendar getTimestamp(); // long getSeqId(); // } // // Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/StateImpl.java // p...
import org.aksw.linkedgeodata.osm.replication.dao.State; import org.aksw.linkedgeodata.osm.replication.dao.StateImpl; import org.apache.jena.enhanced.BuiltinPersonalities; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; import org.apache.jena.system.JenaSubsystemLifecycle; i...
package org.aksw.linkedgeodata.core.init; public class InitJenaLinkedGeoData implements JenaSubsystemLifecycle { private static final Logger logger = LoggerFactory.getLogger(InitJenaLinkedGeoData.class); public void start() { logger.debug("LinkedGeoData Jena initialization"); init(); ...
// Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/State.java // public interface State // extends Resource // { // Calendar getTimestamp(); // long getSeqId(); // } // // Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/StateImpl.java // p...
public static final Resource State = ResourceFactory.createResource("http://example.org/osm/State");
GeoKnow/LinkedGeoData
linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/core/init/InitJenaLinkedGeoData.java
// Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/State.java // public interface State // extends Resource // { // Calendar getTimestamp(); // long getSeqId(); // } // // Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/StateImpl.java // p...
import org.aksw.linkedgeodata.osm.replication.dao.State; import org.aksw.linkedgeodata.osm.replication.dao.StateImpl; import org.apache.jena.enhanced.BuiltinPersonalities; import org.apache.jena.rdf.model.Resource; import org.apache.jena.rdf.model.ResourceFactory; import org.apache.jena.system.JenaSubsystemLifecycle; i...
package org.aksw.linkedgeodata.core.init; public class InitJenaLinkedGeoData implements JenaSubsystemLifecycle { private static final Logger logger = LoggerFactory.getLogger(InitJenaLinkedGeoData.class); public void start() { logger.debug("LinkedGeoData Jena initialization"); init(); ...
// Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/State.java // public interface State // extends Resource // { // Calendar getTimestamp(); // long getSeqId(); // } // // Path: linkedgeodata-core/src/main/java/org/aksw/linkedgeodata/osm/replication/dao/StateImpl.java // p...
.add(State.class, new SimpleImplementation(State.asNode(), StateImpl.class));
splendidbits/play-pushservices
module/app/models/pushservices/db/Recipient.java
// Path: module/app/enums/pushservices/RecipientState.java // public enum RecipientState { // @EnumValue("IDLE") // STATE_IDLE, // // @EnumValue("PROCESSING") // STATE_PROCESSING, // // @EnumValue("FAILED") // STATE_FAILED, // // @EnumValue("WAITING_RETRY") // STATE_WAITING_RETRY, // ...
import com.fasterxml.jackson.annotation.JsonIgnore; import enums.pushservices.RecipientState; import io.ebean.Finder; import io.ebean.Model; import javax.annotation.Nonnull; import javax.persistence.*; import java.util.Date;
package models.pushservices.db; @Entity @Table(name = "recipients", schema = "pushservices") public class Recipient extends Model { public static Finder<Long, Recipient> find = new Finder<>(Recipient.class); @Id @JsonIgnore @Column(name = "id") @SequenceGenerator(name = "gen", sequenceName = "pu...
// Path: module/app/enums/pushservices/RecipientState.java // public enum RecipientState { // @EnumValue("IDLE") // STATE_IDLE, // // @EnumValue("PROCESSING") // STATE_PROCESSING, // // @EnumValue("FAILED") // STATE_FAILED, // // @EnumValue("WAITING_RETRY") // STATE_WAITING_RETRY, // ...
private RecipientState state;
splendidbits/play-pushservices
module/app/injection/pushservices/providers/PushServicesEbeanServerProvider.java
// Path: module/app/main/pushservices/Constants.java // public class Constants { // public static final String CONFIG_PREFIX = "pushservices"; // }
import com.google.inject.Inject; import com.google.inject.Provider; import com.google.inject.Singleton; import com.typesafe.config.Config; import com.typesafe.config.ConfigValue; import com.typesafe.config.ConfigValueType; import io.ebean.EbeanServer; import io.ebean.EbeanServerFactory; import io.ebean.config.ServerCon...
package injection.pushservices.providers; /** * GNU General Public License v3.0. * (This means you can use it as you wish, host and share modifications.) * Copyright 4/2/16 Splendid Bits. */ @Singleton public class PushServicesEbeanServerProvider implements Provider<EbeanServer> { private final Config config...
// Path: module/app/main/pushservices/Constants.java // public class Constants { // public static final String CONFIG_PREFIX = "pushservices"; // } // Path: module/app/injection/pushservices/providers/PushServicesEbeanServerProvider.java import com.google.inject.Inject; import com.google.inject.Provider; import c...
Config pushServicesConfig = configuration.withOnlyPath(Constants.CONFIG_PREFIX);
splendidbits/play-pushservices
module/test/main/PushServicesApplicationTest.java
// Path: module/app/injection/pushservices/modules/PushServicesModule.java // public class PushServicesModule extends AbstractModule { // @Override // protected void configure() { // bind(EbeanServer.class) // .annotatedWith(PushServicesEbeanServer.class) // .toProvider(P...
import injection.pushservices.modules.PushServicesModule; import org.junit.AfterClass; import org.junit.BeforeClass; import play.Application; import play.Mode; import play.api.inject.Binding; import play.api.inject.BindingKey; import play.api.routing.Router; import play.inject.ApplicationLifecycle; import play.inject.g...
package main; /** * GNU General Public License v3.0. * (This means you can use it as you wish, host and share modifications.) * Copyright 28/12/2016 Splendid Bits. */ public abstract class PushServicesApplicationTest { public static Application application; @BeforeClass public static void startAppli...
// Path: module/app/injection/pushservices/modules/PushServicesModule.java // public class PushServicesModule extends AbstractModule { // @Override // protected void configure() { // bind(EbeanServer.class) // .annotatedWith(PushServicesEbeanServer.class) // .toProvider(P...
.bindings(new PushServicesModule())
splendidbits/play-pushservices
module/app/models/pushservices/db/Message.java
// Path: module/app/enums/pushservices/MessagePriority.java // public enum MessagePriority { // @EnumValue("low") // PRIORITY_LOW, // // @EnumValue("normal") // PRIORITY_NORMAL, // // @EnumValue("high") // PRIORITY_HIGH, // }
import enums.pushservices.MessagePriority; import io.ebean.Finder; import io.ebean.Model; import io.ebean.annotation.JsonIgnore; import javax.persistence.*; import java.util.Date; import java.util.List;
package models.pushservices.db; @Entity @Table(name = "messages", schema = "pushservices") public class Message extends Model { public static Finder<Long, Message> find = new Finder<>(Message.class); private static final int TTL_SECONDS_DEFAULT = 60 * 60 * 24 * 7; @Id @JsonIgnore @Column(name = ...
// Path: module/app/enums/pushservices/MessagePriority.java // public enum MessagePriority { // @EnumValue("low") // PRIORITY_LOW, // // @EnumValue("normal") // PRIORITY_NORMAL, // // @EnumValue("high") // PRIORITY_HIGH, // } // Path: module/app/models/pushservices/db/Message.java import enu...
private MessagePriority messagePriority = MessagePriority.PRIORITY_NORMAL;
splendidbits/play-pushservices
module/app/dao/pushservices/MessagesDao.java
// Path: module/app/enums/pushservices/RecipientState.java // public enum RecipientState { // @EnumValue("IDLE") // STATE_IDLE, // // @EnumValue("PROCESSING") // STATE_PROCESSING, // // @EnumValue("FAILED") // STATE_FAILED, // // @EnumValue("WAITING_RETRY") // STATE_WAITING_RETRY, // ...
import annotations.pushservices.PushServicesEbeanServer; import enums.pushservices.RecipientState; import io.ebean.EbeanServer; import io.ebean.FetchConfig; import models.pushservices.db.Message; import play.Logger; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; import ja...
package dao.pushservices; /** * Message persistence. * <p> * GNU General Public License v3.0. * (This means you can use it as you wish, host and share modifications.) * Copyright 5/10/16 Splendid Bits. */ public class MessagesDao { private final EbeanServer mEbeanServer; @Inject public MessagesDao...
// Path: module/app/enums/pushservices/RecipientState.java // public enum RecipientState { // @EnumValue("IDLE") // STATE_IDLE, // // @EnumValue("PROCESSING") // STATE_PROCESSING, // // @EnumValue("FAILED") // STATE_FAILED, // // @EnumValue("WAITING_RETRY") // STATE_WAITING_RETRY, // ...
List<Message> messages = mEbeanServer.find(Message.class).findList();
splendidbits/play-pushservices
module/app/dao/pushservices/MessagesDao.java
// Path: module/app/enums/pushservices/RecipientState.java // public enum RecipientState { // @EnumValue("IDLE") // STATE_IDLE, // // @EnumValue("PROCESSING") // STATE_PROCESSING, // // @EnumValue("FAILED") // STATE_FAILED, // // @EnumValue("WAITING_RETRY") // STATE_WAITING_RETRY, // ...
import annotations.pushservices.PushServicesEbeanServer; import enums.pushservices.RecipientState; import io.ebean.EbeanServer; import io.ebean.FetchConfig; import models.pushservices.db.Message; import play.Logger; import javax.annotation.Nonnull; import javax.annotation.Nullable; import javax.inject.Inject; import ja...
* @return true if the message was updated. */ public boolean saveMessage(@Nonnull Message message) { try { mEbeanServer.save(message); return true; } catch (Exception e) { Logger.error(String.format("Error saving/updating messages into database: %s.", e...
// Path: module/app/enums/pushservices/RecipientState.java // public enum RecipientState { // @EnumValue("IDLE") // STATE_IDLE, // // @EnumValue("PROCESSING") // STATE_PROCESSING, // // @EnumValue("FAILED") // STATE_FAILED, // // @EnumValue("WAITING_RETRY") // STATE_WAITING_RETRY, // ...
.eq("recipients.state", RecipientState.STATE_IDLE)
splendidbits/play-pushservices
module/app/injection/pushservices/modules/PushServicesModule.java
// Path: module/app/injection/pushservices/providers/PushServicesEbeanServerProvider.java // @Singleton // public class PushServicesEbeanServerProvider implements Provider<EbeanServer> { // private final Config configuration; // // @Inject // public PushServicesEbeanServerProvider(Config configuration) { /...
import annotations.pushservices.PushServicesEbeanServer; import com.google.inject.AbstractModule; import com.google.inject.Singleton; import injection.pushservices.providers.PushServicesEbeanServerProvider; import io.ebean.EbeanServer; import main.pushservices.PushLifecycleListener;
package injection.pushservices.modules; /** * GNU General Public License v3.0. * (This means you can use it as you wish, host and share modifications.) * Copyright 02/01/2017 Splendid Bits. */ public class PushServicesModule extends AbstractModule { @Override protected void configure() { bind(Ebea...
// Path: module/app/injection/pushservices/providers/PushServicesEbeanServerProvider.java // @Singleton // public class PushServicesEbeanServerProvider implements Provider<EbeanServer> { // private final Config configuration; // // @Inject // public PushServicesEbeanServerProvider(Config configuration) { /...
.toProvider(PushServicesEbeanServerProvider.class)
splendidbits/play-pushservices
module/app/injection/pushservices/modules/PushServicesModule.java
// Path: module/app/injection/pushservices/providers/PushServicesEbeanServerProvider.java // @Singleton // public class PushServicesEbeanServerProvider implements Provider<EbeanServer> { // private final Config configuration; // // @Inject // public PushServicesEbeanServerProvider(Config configuration) { /...
import annotations.pushservices.PushServicesEbeanServer; import com.google.inject.AbstractModule; import com.google.inject.Singleton; import injection.pushservices.providers.PushServicesEbeanServerProvider; import io.ebean.EbeanServer; import main.pushservices.PushLifecycleListener;
package injection.pushservices.modules; /** * GNU General Public License v3.0. * (This means you can use it as you wish, host and share modifications.) * Copyright 02/01/2017 Splendid Bits. */ public class PushServicesModule extends AbstractModule { @Override protected void configure() { bind(Ebea...
// Path: module/app/injection/pushservices/providers/PushServicesEbeanServerProvider.java // @Singleton // public class PushServicesEbeanServerProvider implements Provider<EbeanServer> { // private final Config configuration; // // @Inject // public PushServicesEbeanServerProvider(Config configuration) { /...
bind(PushLifecycleListener.class)
splendidbits/play-pushservices
module/app/models/pushservices/db/Credentials.java
// Path: module/app/enums/pushservices/PlatformType.java // public enum PlatformType { // @EnumValue("GCM") // SERVICE_GCM("GCM", "https://fcm.googleapis.com/fcm/send"), // // @EnumValue( "APNS") // SERVICE_APNS("APNS", "https://gateway.sandbox.push.apple.com"); // // public String name; // pu...
import com.fasterxml.jackson.annotation.JsonIgnore; import enums.pushservices.PlatformType; import io.ebean.Finder; import io.ebean.Model; import javax.persistence.*;
package models.pushservices.db; @Entity @Table(name = "credentials", schema = "pushservices") public class Credentials extends Model { public static Finder<Long, Credentials> find = new Finder<>(Credentials.class); @Id @JsonIgnore @Column(name = "id") @SequenceGenerator(name = "gen", sequenceNam...
// Path: module/app/enums/pushservices/PlatformType.java // public enum PlatformType { // @EnumValue("GCM") // SERVICE_GCM("GCM", "https://fcm.googleapis.com/fcm/send"), // // @EnumValue( "APNS") // SERVICE_APNS("APNS", "https://gateway.sandbox.push.apple.com"); // // public String name; // pu...
private PlatformType platformType;
splendidbits/play-pushservices
sample/app/injection/ApplicationClassLoader.java
// Path: module/app/injection/pushservices/modules/PushServicesModule.java // public class PushServicesModule extends AbstractModule { // @Override // protected void configure() { // bind(EbeanServer.class) // .annotatedWith(PushServicesEbeanServer.class) // .toProvider(P...
import injection.pushservices.modules.PushServicesModule; import play.ApplicationLoader; import play.inject.guice.GuiceApplicationBuilder; import play.inject.guice.GuiceApplicationLoader;
package injection; /** * GNU General Public License v3.0. * (This means you can use it as you wish, host and share modifications.) * Copyright 01/01/2017 Splendid Bits. */ public class ApplicationClassLoader extends GuiceApplicationLoader { @Override public GuiceApplicationBuilder builder(ApplicationLoade...
// Path: module/app/injection/pushservices/modules/PushServicesModule.java // public class PushServicesModule extends AbstractModule { // @Override // protected void configure() { // bind(EbeanServer.class) // .annotatedWith(PushServicesEbeanServer.class) // .toProvider(P...
.bindings(new PushServicesModule());
aikuma/aikuma
Aikuma/src/org/lp20/aikuma/audio/record/analyzers/ThresholdSpeechAnalyzer.java
// Path: Aikuma/src/org/lp20/aikuma/audio/record/AudioHandler.java // public interface AudioHandler { // // /** // * The caller has detected non-silent audio. // * // * @param buffer An array of samples. // * @param justChanged Whether the caller has just changed // * from silence to audio. // */ /...
import java.util.Arrays; import android.util.Log; import org.lp20.aikuma.audio.record.AudioHandler; import org.lp20.aikuma.audio.record.analyzers.Analyzer; import org.lp20.aikuma.audio.record.recognizers.Recognizer; import org.lp20.aikuma.audio.record.recognizers.AverageRecognizer;
short[] copiedBuffer = Arrays.copyOf(buffer, buffer.length); // Add the copied current buffer onto the end. // for (int i = 0; i < buffer.length; i++) { onsetBuffer[i + offset] = copiedBuffer[i]; } } /** Clear the before speech buffer. */ protected void clearOnsetBuffer() { onsetBuffer = new short[...
// Path: Aikuma/src/org/lp20/aikuma/audio/record/AudioHandler.java // public interface AudioHandler { // // /** // * The caller has detected non-silent audio. // * // * @param buffer An array of samples. // * @param justChanged Whether the caller has just changed // * from silence to audio. // */ /...
public void analyze(AudioHandler handler, short[] buffer) {
pentaho/pentaho-engineering-samples
Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/groups/PentahoSamlNativeUserRoleListService.java
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
import org.pentaho.platform.api.engine.IUserRoleListService; import org.pentaho.platform.api.mt.ITenant; import org.pentaho.platform.engine.core.system.PentahoSystem; import org.pentaho.platform.spring.security.saml.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core...
package org.pentaho.platform.spring.security.saml.groups; public class PentahoSamlNativeUserRoleListService implements IUserRoleListService { private static final Logger logger = LoggerFactory.getLogger( PentahoSamlNativeUserRoleListService.class ); private List<String> systemRoles; private PentahoSamlNativ...
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
return Arrays.asList( Utils.getDefaultRole().getAuthority() );
pentaho/pentaho-engineering-samples
Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/logout/PentahoSamlSuccessLogoutHandler.java
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
import org.pentaho.platform.spring.security.saml.Utils; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.logout.SimpleUrlLogoutSuccessHandler; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.Htt...
package org.pentaho.platform.spring.security.saml.logout; public class PentahoSamlSuccessLogoutHandler extends SimpleUrlLogoutSuccessHandler { public void onLogoutSuccess( HttpServletRequest request, HttpServletResponse response, Authentication auth ) throws IOException, ServletException { if( auth != ...
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
Utils.getUserMap().remove( auth.getPrincipal().toString() );
pentaho/pentaho-engineering-samples
Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/logout/PentahoSamlLogoutProcessingFilter.java
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
import org.pentaho.platform.proxy.impl.ProxyException; import org.pentaho.platform.spring.security.saml.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.security.core.Authentication; import org.springframework.security.core.context.SecurityContextHolder; import org.springframew...
package org.pentaho.platform.spring.security.saml.logout; public class PentahoSamlLogoutProcessingFilter extends SAMLLogoutProcessingFilter { private static final Logger LOGGER = LoggerFactory.getLogger( PentahoSamlLogoutProcessingFilter.class ); private boolean requireProxyWrapping = true; public PentahoSa...
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
Authentication auth = Utils.getAuthenticationFromRequest( request, isRequireProxyWrapping() );
pentaho/pentaho-engineering-samples
Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/groups/PentahoSamlNativeUserDetailsService.java
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.opensaml.saml2.core.Attribute; import org.opensaml.xml.XMLObject; import org.opensaml.xml.schema.impl.XSAnyImpl; import org.opensaml.xml.schema.impl.XSStringImpl; import org.pentaho.platform.api.mt.ITenantedPrincipleNameResolver;...
package org.pentaho.platform.spring.security.saml.groups; /** * Checks the users attributes list, to try and fetch the roles from there * The user credentials are those sent within the SAML Authentication Response */ public class PentahoSamlNativeUserDetailsService implements SAMLUserDetailsService, UserDetailsSe...
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/Utils.java // public class Utils { // // public final static String SPRING_2_SECURITY_CTX_KEY = "SPRING_SECURITY_CONTEXT"; // // /** // * roles considered to b...
authorities.add( Utils.getDefaultRole() );
pentaho/pentaho-engineering-samples
Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/PentahoSamlUserRoleListService.java
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/groups/PentahoSamlNativeUserRoleListService.java // public class PentahoSamlNativeUserRoleListService implements IUserRoleListService { // // private static final Lo...
import java.util.HashMap; import java.util.List; import java.util.Map; import org.pentaho.platform.api.engine.IUserRoleListService; import org.pentaho.platform.api.mt.ITenant; import org.pentaho.platform.engine.core.system.PentahoSystem; import org.pentaho.platform.spring.security.saml.groups.PentahoSamlNativeUserRoleL...
package org.pentaho.platform.spring.security.saml; public class PentahoSamlUserRoleListService implements IUserRoleListService { private static Logger logger = LoggerFactory.getLogger( PentahoSamlUserRoleListService.class ); private static final String PROVIDER_NAME = "providerName"; //Delegate user role li...
// Path: Samples_for_Extending_Pentaho/Reference Implementations/Security/SAML 2.0/pentaho-saml/src/main/java/org/pentaho/platform/spring/security/saml/groups/PentahoSamlNativeUserRoleListService.java // public class PentahoSamlNativeUserRoleListService implements IUserRoleListService { // // private static final Lo...
private PentahoSamlNativeUserRoleListService samlUserRoleListService;
nativelibs4java/BridJ
src/main/java/org/bridj/jawt/JAWT.java
// Path: src/main/java/org/bridj/jawt/JawtLibrary.java // public static class JNIEnv extends TypedPointer { // // public JNIEnv(long address) { // super(address); // } // // public JNIEnv(Pointer address) { // super(address); // } // };
import org.bridj.Callback; import org.bridj.Pointer; import org.bridj.StructObject; import org.bridj.ann.Convention; import org.bridj.ann.Field; import org.bridj.ann.Library; import org.bridj.jawt.JawtLibrary.JNIEnv;
return this; } @Field(1) public Pointer<GetDrawingSurface_callback> GetDrawingSurface() { return this.io.getPointerField(this, 1); } @Field(2) public Pointer<FreeDrawingSurface_callback> FreeDrawingSurface() { return this.io.getPointerField(this, 2); } @Field(3...
// Path: src/main/java/org/bridj/jawt/JawtLibrary.java // public static class JNIEnv extends TypedPointer { // // public JNIEnv(long address) { // super(address); // } // // public JNIEnv(Pointer address) { // super(address); // } // }; // Path: src/main/java/org/bridj/jawt/JAWT.java...
public abstract Pointer<org.bridj.jawt.JAWT_DrawingSurface> invoke(Pointer<JNIEnv> env, Pointer<?> target);
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/Set.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // }
import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList;
/* * 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 minlp; /** * * @author marcio */ public class Set { private final MINLP mip; protected final LinkedList<Integer> s...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // Path: MINLP/src/minlp/Set.java import...
public void forAll(Consumer action) throws Exception{
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/Set.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // }
import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList;
/* * 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 minlp; /** * * @author marcio */ public class Set { private final MINLP mip; protected final LinkedList<Integer> s...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // Path: MINLP/src/minlp/Set.java import...
public Expr sum(final Function mapper) throws Exception{
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* @return * @throws Exception */ public final Set range(int begin, int end) throws Exception { LinkedList<Integer> list = new LinkedList<>(); for(int i=begin; i<=end; i++){ list.addLast(i); } return new Set(this, list); } /** * <pre> ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public void forAll(Set set, Consumer action) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* cplex.addLe(x[j], 3); * }); * </pre> * @param set set of indexes * @param action the action to be performed * @throws java.lang.Exception */ public void forAll(Set set, Consumer action) throws Exception { set.forAll(action); } /** * <pre> ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public void forAll(Set s1, Set s2, Consumer2p action) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* @throws java.lang.Exception */ public void forAll(Set s1, Set s2, Consumer2p action) throws Exception { s1.forAll(i -> s2.forAll(j -> action.accept(i, j) ) ); } /** * <pre> * Interpratation: * for all(i in I and j in ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public void forAll(Set s1, Set s2, Set s3, Consumer3p action) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
s1.forAll(i -> s2.forAll(j -> s3.forAll(k -> action.accept(i, j, k) ) ) ); } /** * <pre> * Interpratation: * for all(i in I and j in J and k in K and m in M) { * //do something here ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public void forAll(Set s1, Set s2, Set s3, Set s4, Consumer4p action) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
s4.forAll(m -> action.accept(i, j, k, m) ) ) ) ); } /** * <pre> * Interpratation: * for all(i in I and j in J and k in K and m in M and n in N) { * //do something here * ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public void forAll(Set s1, Set s2, Set s3, Set s4, Set s5, Consumer5p action) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* @param action the action to be performed * @throws java.lang.Exception */ public void forAll(Set s1, Set s2, Set s3, Set s4, Set s5, Consumer5p action) throws Exception { s1.forAll(i -> s2.forAll(j -> s3.forAll(k -> s4.forAll(m -> ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public Expr sum(Set set, Function mapper) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* Interpratation: * sum_{i in I}{expression} * Simtax: * cplex.sum(I, i -> expression) * Sample: * cplex.sum(I, i -> cplex.prod(C[i],x[i])) * </pre> * @param set * @param mapper * @return * @throws java.lang.Exception */ public Expr sum(Se...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public Expr sum(Set s1, Set s2, Function2p mapper) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* @param s1 first set of index * @param s2 second set of index * @param mapper * @return * @throws java.lang.Exception */ public Expr sum(Set s1, Set s2, Function2p mapper) throws Exception { return s1.sum(i -> s2.sum(j -> ma...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public Expr sum(Set s1, Set s2, Set s3, Function3p mapper) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
* @return * @throws java.lang.Exception */ public Expr sum(Set s1, Set s2, Set s3, Function3p mapper) throws Exception { return s1.sum(i -> s2.sum(j -> s3.sum(k -> mapper.accept(i, j, k) ) ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public Expr sum(Set s1, Set s2, Set s3, Set s4, Function4p mapper) throws Exception {
marcio-da-silva-arantes/MINLP
MINLP/src/minlp/MINLP.java
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
import java.io.PrintStream; import java.util.Arrays; import minlp.stream.Function; import minlp.stream.Consumer; import java.util.LinkedList; import minlp.stream.Consumer2p; import minlp.stream.Consumer3p; import minlp.stream.Consumer4p; import minlp.stream.Consumer5p; import minlp.stream.Function2p; import minlp.strea...
public Expr sum(Set s1, Set s2, Set s3, Set s4, Function4p mapper) throws Exception { return s1.sum(i -> s2.sum(j -> s3.sum(k -> s4.sum(m -> mapper.accept(i, j, k, m) ) ...
// Path: MINLP/src/minlp/stream/Function.java // public interface Function { // public Expr accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consumer.java // public interface Consumer { // public void accept(Integer t) throws Exception; // } // // Path: MINLP/src/minlp/stream/Consum...
public Expr sum(Set s1, Set s2, Set s3, Set s4, Set s5, Function5p mapper) throws Exception {
flexgp/flexgp
comm-library/src/node/NodeList.java
// Path: comm-library/src/network/MessageType.java // public class MessageType { // // Control-related messages // public final static int PING = 0; // public static final int PING_RESPONSE = 1; // public static int STATUS = 2; // public static int STATUS_RESPONSE = 3; // public static int CONTROL_FLOW = 4; // p...
import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Random; import java.util.Set; import network.MessageType; import utility.IP;
* Return values indicating if the good/bad node tables contain an entry for * nID * * @param nID */ public synchronized Status contains(String nID) { if (goodNodeTable.containsKey(nID)) return Status.GOOD; else if (badNodeTable.containsKey(nID)) return Status.BAD; return Status.NONE; } public...
// Path: comm-library/src/network/MessageType.java // public class MessageType { // // Control-related messages // public final static int PING = 0; // public static final int PING_RESPONSE = 1; // public static int STATUS = 2; // public static int STATUS_RESPONSE = 3; // public static int CONTROL_FLOW = 4; // p...
public void succeed(IP ip, String s, Timestamp t) {
flexgp/flexgp
comm-library/src/node/NodeList.java
// Path: comm-library/src/network/MessageType.java // public class MessageType { // // Control-related messages // public final static int PING = 0; // public static final int PING_RESPONSE = 1; // public static int STATUS = 2; // public static int STATUS_RESPONSE = 3; // public static int CONTROL_FLOW = 4; // p...
import java.io.Serializable; import java.sql.Timestamp; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Random; import java.util.Set; import network.MessageType; import utility.IP;
/** * Get a current timestamp * * @return */ public static Timestamp currTime() { return new Timestamp(new Date().getTime()); } public void succeed(IP ip, String s, Timestamp t) { succeed(ip.id, ip.ip, ip.port, s, t); } public void succeed(String nodeID, NodeListEntry nle, Timestamp t) { succeed(...
// Path: comm-library/src/network/MessageType.java // public class MessageType { // // Control-related messages // public final static int PING = 0; // public static final int PING_RESPONSE = 1; // public static int STATUS = 2; // public static int STATUS_RESPONSE = 3; // public static int CONTROL_FLOW = 4; // p...
badNodeTable.size(), 0, 1, 0, MessageType.PING);
flexgp/flexgp
mrgp-flexgp/src/evogpj/math/Var.java
// Path: mrgp-flexgp/src/evogpj/gp/GPException.java // public class GPException extends Exception { // // /** // * Constructor for GP exceptions // * @param string // */ // public GPException(String string) { // super(string); // } // // /** // * // */ /...
import evogpj.gp.GPException; import java.util.ArrayList; import java.util.List;
/** * Copyright (c) 2011-2013 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHAN...
// Path: mrgp-flexgp/src/evogpj/gp/GPException.java // public class GPException extends Exception { // // /** // * Constructor for GP exceptions // * @param string // */ // public GPException(String string) { // super(string); // } // // /** // * // */ /...
public Var(String label,double acoeff) throws GPException {
flexgp/flexgp
mrgp-flexgp/src/evogpj/evaluation/java/ScaledData.java
// Path: mrgp-flexgp/src/evogpj/math/means/ArithmeticMean.java // public class ArithmeticMean extends Mean { // // @Override // public Double getMean() { // return sum / (double) n; // } // // @Override // public void addValue(Double val) { // incrementN(); // sum += val; // } // // }
import evogpj.math.means.ArithmeticMean; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter;
/** * Copyright (c) 2011-2013 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHAN...
// Path: mrgp-flexgp/src/evogpj/math/means/ArithmeticMean.java // public class ArithmeticMean extends Mean { // // @Override // public Double getMean() { // return sum / (double) n; // } // // @Override // public void addValue(Double val) { // incrementN(); // sum += val; // } // // } // Path: mrgp-fle...
public ArithmeticMean targetMean;
flexgp/flexgp
mrgp-flexgp/src/evogpj/evaluation/java/CSVDataJava.java
// Path: mrgp-flexgp/src/evogpj/evaluation/DataSizeRetreiver.java // public class DataSizeRetreiver { // /** // * Set the number of explanatory variables present in the file // * // * @param filepath // * @return number of explanatory variables in the data // */ // public static int num_termi...
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import evogpj.evaluation.DataSizeRetreiver;
/** * Copyright (c) 2011-2013 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHAN...
// Path: mrgp-flexgp/src/evogpj/evaluation/DataSizeRetreiver.java // public class DataSizeRetreiver { // /** // * Set the number of explanatory variables present in the file // * // * @param filepath // * @return number of explanatory variables in the data // */ // public static int num_termi...
super(DataSizeRetreiver.num_fitness_cases(csvfile), DataSizeRetreiver.num_terminals(csvfile));
flexgp/flexgp
comm-library/src/network/MessageWrapper.java
// Path: comm-library/src/node/NodeListEntry.java // public class NodeListEntry extends Object implements Serializable { // private static final long serialVersionUID = -1638892096321023484L; // // // the IP // public String ip; // // the port // public int port; // // sub-network label for second-tier nodes //...
import node.NodeListEntry;
/** * Copyright (c) 2012 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABIL...
// Path: comm-library/src/node/NodeListEntry.java // public class NodeListEntry extends Object implements Serializable { // private static final long serialVersionUID = -1638892096321023484L; // // // the IP // public String ip; // // the port // public int port; // // sub-network label for second-tier nodes //...
public final NodeListEntry nle;
flexgp/flexgp
comm-library/src/node/NodeDescriptor.java
// Path: comm-library/src/utility/IP.java // public class IP { // public String id; // public String ip; // public int port; // // public IP(String _id, String _ip, int _port) { // id = _id; // ip = _ip; // port = _port; // } // // public boolean equals(IP other) { // return ((this.id == other.id) && (t...
import utility.IP;
/** * Copyright (c) 2012 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILIT...
// Path: comm-library/src/utility/IP.java // public class IP { // public String id; // public String ip; // public int port; // // public IP(String _id, String _ip, int _port) { // id = _id; // ip = _ip; // port = _port; // } // // public boolean equals(IP other) { // return ((this.id == other.id) && (t...
private final IP ip;
flexgp/flexgp
mrgp-flexgp/src/evogpj/genotype/Tree.java
// Path: mrgp-flexgp/src/evogpj/gp/GPException.java // public class GPException extends Exception { // // /** // * Constructor for GP exceptions // * @param string // */ // public GPException(String string) { // super(string); // } // // /** // * // */ /...
import evogpj.gp.GPException; import java.util.List; import evogpj.math.Function;
/** * Set the scaling slope (the "b" in y = ax + b) of this individual * @param slope */ public void setScalingSlope(Double slope) { scalingCoeffs[0] = slope; } /** * @return the "b" coefficient in y = ax + b */ public Double getScalingIntercept() { return s...
// Path: mrgp-flexgp/src/evogpj/gp/GPException.java // public class GPException extends Exception { // // /** // * Constructor for GP exceptions // * @param string // */ // public GPException(String string) { // super(string); // } // // /** // * // */ /...
public Function generate() {
flexgp/flexgp
mrgp-flexgp/src/evogpj/genotype/Tree.java
// Path: mrgp-flexgp/src/evogpj/gp/GPException.java // public class GPException extends Exception { // // /** // * Constructor for GP exceptions // * @param string // */ // public GPException(String string) { // super(string); // } // // /** // * // */ /...
import evogpj.gp.GPException; import java.util.List; import evogpj.math.Function;
scalingCoeffs[0] = slope; } /** * @return the "b" coefficient in y = ax + b */ public Double getScalingIntercept() { return scalingCoeffs[1]; } /** * Set the scaling intercept (the "b" in y = ax + b) of this individual * @param intercept */ public void...
// Path: mrgp-flexgp/src/evogpj/gp/GPException.java // public class GPException extends Exception { // // /** // * Constructor for GP exceptions // * @param string // */ // public GPException(String string) { // super(string); // } // // /** // * // */ /...
} catch (GPException e) {
flexgp/flexgp
comm-library/src/test/ArgLexerTest.java
// Path: comm-library/src/utility/ArgLexer.java // public class ArgLexer { // // the raw arguments // public String[] args; // // the lexed tokens // public ArrayList<String> tokens; // // the grouped tokens, of the form '-i' --> 'commandLine text' // public HashMap<String, String> groups; // // public ArgLexer...
import static org.junit.Assert.assertTrue; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import org.junit.Test; import utility.ArgLexer;
/** * Copyright (c) 2012 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABIL...
// Path: comm-library/src/utility/ArgLexer.java // public class ArgLexer { // // the raw arguments // public String[] args; // // the lexed tokens // public ArrayList<String> tokens; // // the grouped tokens, of the form '-i' --> 'commandLine text' // public HashMap<String, String> groups; // // public ArgLexer...
ArgLexer al = new ArgLexer(args);
flexgp/flexgp
comm-library/src/node/Reporter.java
// Path: comm-library/src/utility/JSONFilter.java // public class JSONFilter implements Filter { // // /* (non-Javadoc) // * @see java.util.logging.Filter#isLoggable(java.util.logging.LogRecord) // */ // @Override // public boolean isLoggable(LogRecord record) { // return JSONValue.isValidJsonStrict(record.ge...
import java.io.IOException; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import net.minidev.json.JSONObject; import utility.JSONFilter; import utility.JSONFormatte...
/** * Copyright (c) 2012 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILIT...
// Path: comm-library/src/utility/JSONFilter.java // public class JSONFilter implements Filter { // // /* (non-Javadoc) // * @see java.util.logging.Filter#isLoggable(java.util.logging.LogRecord) // */ // @Override // public boolean isLoggable(LogRecord record) { // return JSONValue.isValidJsonStrict(record.ge...
private Signal sig;
flexgp/flexgp
comm-library/src/node/Reporter.java
// Path: comm-library/src/utility/JSONFilter.java // public class JSONFilter implements Filter { // // /* (non-Javadoc) // * @see java.util.logging.Filter#isLoggable(java.util.logging.LogRecord) // */ // @Override // public boolean isLoggable(LogRecord record) { // return JSONValue.isValidJsonStrict(record.ge...
import java.io.IOException; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import net.minidev.json.JSONObject; import utility.JSONFilter; import utility.JSONFormatte...
/** * Copyright (c) 2012 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILIT...
// Path: comm-library/src/utility/JSONFilter.java // public class JSONFilter implements Filter { // // /* (non-Javadoc) // * @see java.util.logging.Filter#isLoggable(java.util.logging.LogRecord) // */ // @Override // public boolean isLoggable(LogRecord record) { // return JSONValue.isValidJsonStrict(record.ge...
fh.setFormatter(new JSONFormatter());
flexgp/flexgp
comm-library/src/node/Reporter.java
// Path: comm-library/src/utility/JSONFilter.java // public class JSONFilter implements Filter { // // /* (non-Javadoc) // * @see java.util.logging.Filter#isLoggable(java.util.logging.LogRecord) // */ // @Override // public boolean isLoggable(LogRecord record) { // return JSONValue.isValidJsonStrict(record.ge...
import java.io.IOException; import java.util.Map; import java.util.concurrent.BlockingQueue; import java.util.logging.FileHandler; import java.util.logging.Handler; import java.util.logging.Level; import java.util.logging.Logger; import net.minidev.json.JSONObject; import utility.JSONFilter; import utility.JSONFormatte...
/** * Copyright (c) 2012 Evolutionary Design and Optimization Group * * Licensed under the MIT License. * * See the "LICENSE" file for a copy of the license. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILIT...
// Path: comm-library/src/utility/JSONFilter.java // public class JSONFilter implements Filter { // // /* (non-Javadoc) // * @see java.util.logging.Filter#isLoggable(java.util.logging.LogRecord) // */ // @Override // public boolean isLoggable(LogRecord record) { // return JSONValue.isValidJsonStrict(record.ge...
fh.setFilter(new JSONFilter());
flexgp/flexgp
mrgp-flexgp/src/evogpj/gp/Population.java
// Path: mrgp-flexgp/src/evogpj/evaluation/FitnessComparisonStandardizer.java // public class FitnessComparisonStandardizer { // // /** // * Standardizes the way by which fitnesses are compared. Will always return // * a fitness score where lower indicates better. // * // * @param individual // ...
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.LinkedHashMap; ...
if (!this.get(i).equals(otherL.get(i))) return false; } return true; } /** * perform a deep copy of the population * @return */ public Population deepCopy() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos; try { oos = new Objec...
// Path: mrgp-flexgp/src/evogpj/evaluation/FitnessComparisonStandardizer.java // public class FitnessComparisonStandardizer { // // /** // * Standardizes the way by which fitnesses are compared. Will always return // * a fitness score where lower indicates better. // * // * @param individual // ...
public void calculateEuclideanDistances(LinkedHashMap<String, FitnessFunction> fitnessFunctions) {
flexgp/flexgp
mrgp-flexgp/src/evogpj/gp/Population.java
// Path: mrgp-flexgp/src/evogpj/evaluation/FitnessComparisonStandardizer.java // public class FitnessComparisonStandardizer { // // /** // * Standardizes the way by which fitnesses are compared. Will always return // * a fitness score where lower indicates better. // * // * @param individual // ...
import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.io.Serializable; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.LinkedHashMap; ...
*/ public Population deepCopy() { ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos; try { oos = new ObjectOutputStream(bos); oos.writeObject(this); ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(bos.toByteArray())); return (Population) o...
// Path: mrgp-flexgp/src/evogpj/evaluation/FitnessComparisonStandardizer.java // public class FitnessComparisonStandardizer { // // /** // * Standardizes the way by which fitnesses are compared. Will always return // * a fitness score where lower indicates better. // * // * @param individual // ...
Double standardizedMin = FitnessComparisonStandardizer.getFitnessForMinimization(maxes, key, fitnessFunctions);
BroadleafCommerce/blc-paypal
services/src/test/java/org/broadleaf/payment/service/gateway/PayPalCheckoutRetryPolicyClassifierTest.java
// Path: services/src/main/java/org/broadleafcommerce/payment/service/gateway/DefaultPayPalCheckoutRetryPolicyClassifier.java // @RequiredArgsConstructor // public class DefaultPayPalCheckoutRetryPolicyClassifier // implements Classifier<Throwable, RetryPolicy> { // // @Getter(AccessLevel.PROTECTED) // ...
import static org.assertj.core.api.Assertions.assertThat; import org.broadleafcommerce.payment.service.gateway.DefaultPayPalCheckoutRetryPolicyClassifier; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.springframework.retry.RetryPolicy; impo...
/* * Copyright (C) 2009 - 2020 Broadleaf Commerce * * Licensed under the Broadleaf End User License Agreement (EULA), Version 1.1 (the * "Commercial License" located at http://license.broadleafcommerce.org/commercial_license-1.1.txt). * * Alternatively, the Commercial License may be replaced with a mutually agree...
// Path: services/src/main/java/org/broadleafcommerce/payment/service/gateway/DefaultPayPalCheckoutRetryPolicyClassifier.java // @RequiredArgsConstructor // public class DefaultPayPalCheckoutRetryPolicyClassifier // implements Classifier<Throwable, RetryPolicy> { // // @Getter(AccessLevel.PROTECTED) // ...
DefaultPayPalCheckoutRetryPolicyClassifier retryPolicyClassifier;
BroadleafCommerce/blc-paypal
services/src/main/java/org/broadleafcommerce/payment/service/gateway/PayPalCheckoutRestConfigurationProperties.java
// Path: services/src/main/java/org/broadleafcommerce/vendor/paypal/service/PayPalWebExperienceProfileService.java // public interface PayPalWebExperienceProfileService { // // /** // * Retrieves the id of the WebProfile to be used when creating a PayPal payment // * // * @return // * @throws ...
import javax.annotation.PostConstruct; import lombok.AccessLevel; import lombok.Getter; import lombok.NonNull; import lombok.Setter; import lombok.extern.apachecommons.CommonsLog; import org.apache.commons.lang3.StringUtils; import org.broadleafcommerce.vendor.paypal.service.PayPalWebExperienceProfileService; import or...
* company/entity. */ private String clientId; /** * The client secret provided by PayPal that is used in API calls to verify the applications * usage of the client id. * * @return The client secret provided by PayPal that is used in API calls to verify the * a...
// Path: services/src/main/java/org/broadleafcommerce/vendor/paypal/service/PayPalWebExperienceProfileService.java // public interface PayPalWebExperienceProfileService { // // /** // * Retrieves the id of the WebProfile to be used when creating a PayPal payment // * // * @return // * @throws ...
private String totalType = MessageConstants.TOTAL;
BroadleafCommerce/blc-paypal
services/src/main/java/org/broadleafcommerce/vendor/paypal/api/ReportingTransactions.java
// Path: services/src/main/java/org/broadleafcommerce/vendor/paypal/domain/ReportingTransactionResponse.java // public class ReportingTransactionResponse extends PayPalModel { // // public ReportingTransactionResponse() { // // } // // private List<TransactionDetail> transaction_details; // // priva...
import org.broadleafcommerce.vendor.paypal.domain.ReportingTransactionResponse; import com.paypal.base.rest.APIContext; import com.paypal.base.rest.HttpMethod; import com.paypal.base.rest.PayPalRESTException; import com.paypal.base.rest.PayPalResource; import com.paypal.base.rest.RESTUtil; import java.util.Map;
/* * Copyright (C) 2009 - 2020 Broadleaf Commerce * * Licensed under the Broadleaf End User License Agreement (EULA), Version 1.1 (the * "Commercial License" located at http://license.broadleafcommerce.org/commercial_license-1.1.txt). * * Alternatively, the Commercial License may be replaced with a mutually agree...
// Path: services/src/main/java/org/broadleafcommerce/vendor/paypal/domain/ReportingTransactionResponse.java // public class ReportingTransactionResponse extends PayPalModel { // // public ReportingTransactionResponse() { // // } // // private List<TransactionDetail> transaction_details; // // priva...
public ReportingTransactionResponse get(Map<String, String> queryParams, APIContext apiContext)
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchMvp.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { // // static final Lap BAD_LAP = create(-1L, -1L); // // public static Lap create(long duration, long endTime) { // return new AutoValue_Lap(duration, endTim...
import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting;
package com.autonomousapps.reactivestopwatch.ui; public interface StopwatchMvp { interface View { void onTick(long tick); void onStopwatchStarted(); void onStopwatchStopped(); void onStopwatchReset();
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { // // static final Lap BAD_LAP = create(-1L, -1L); // // public static Lap create(long duration, long endTime) { // return new AutoValue_Lap(duration, endTim...
void onNewLap(@NonNull Lap lap);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchMvp.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { // // static final Lap BAD_LAP = create(-1L, -1L); // // public static Lap create(long duration, long endTime) { // return new AutoValue_Lap(duration, endTim...
import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting;
package com.autonomousapps.reactivestopwatch.ui; public interface StopwatchMvp { interface View { void onTick(long tick); void onStopwatchStarted(); void onStopwatchStopped(); void onStopwatchReset(); void onNewLap(@NonNull Lap lap); /* * Manual inj...
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { // // static final Lap BAD_LAP = create(-1L, -1L); // // public static Lap create(long duration, long endTime) { // return new AutoValue_Lap(duration, endTim...
void setTimeTeller(@NonNull TimeTeller timeTeller);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import android.app.Application; import android.support.annotation.NonNull; import android.support.annotation.Nullable;
package com.autonomousapps; public abstract class LifecycleLoggingApplication extends Application { private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); @Override public void onCreate() { super.onCreate(); log("onCreate()"); } @Override publi...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
LogUtil.v(TAG, msg, args);
autonomousapps/ReactiveStopwatch
app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractMockedDependenciesTest.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
import com.autonomousapps.reactivestopwatch.di.DaggerTestStopwatchComponent; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.di.TestStopwatchComponent; import org.junit.Before; import android.support.annotation.CallSuper;
package com.autonomousapps.reactivestopwatch.test; public abstract class AbstractMockedDependenciesTest extends AbstractAnimationDisablingTest { protected TestStopwatchComponent testComponent; @Before @CallSuper public void setup() throws Exception { initInjections(); } private vo...
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
DaggerUtil.INSTANCE.setComponent(testComponent);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchPresenter.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
import com.autonomousapps.reactivestopwatch.mvp.ViewNotAttachedException; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.support.annotation.NonNull; import android.support.annotation.UiThread; import android.support.annotation.VisibleForT...
package com.autonomousapps.reactivestopwatch.ui; @UiThread public class StopwatchPresenter implements StopwatchMvp.Presenter { private static final String TAG = StopwatchPresenter.class.getSimpleName();
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
private final Stopwatch stopwatch;
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchPresenter.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
import com.autonomousapps.reactivestopwatch.mvp.ViewNotAttachedException; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.support.annotation.NonNull; import android.support.annotation.UiThread; import android.support.annotation.VisibleForT...
} else { getView().onStopwatchStarted(); } } @Override public void resetOrLap() { Log.d(TAG, "resetOrLap()"); if (isRunning()) { lap(); } else { reset(); } } private boolean isRunning() { return stopwatchS...
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
Lap lap = stopwatch.lap();
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchPresenter.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
import com.autonomousapps.reactivestopwatch.mvp.ViewNotAttachedException; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.support.annotation.NonNull; import android.support.annotation.UiThread; import android.support.annotation.VisibleForT...
Log.d(TAG, "resetOrLap()"); if (isRunning()) { lap(); } else { reset(); } } private boolean isRunning() { return stopwatchSubscription != null && !stopwatch.isPaused(); } private void reset() { stopwatch.reset(); if (stop...
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
throw new ViewNotAttachedException();
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/StopwatchApplication.java
// Path: app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java // public abstract class LifecycleLoggingApplication extends Application { // // private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); // // @Override // public void onCreate() { // super....
import com.autonomousapps.LifecycleLoggingApplication; import com.autonomousapps.reactivestopwatch.di.ContextModule; import com.autonomousapps.reactivestopwatch.di.DaggerStopwatchComponent; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.di.StopwatchComponent;
package com.autonomousapps.reactivestopwatch; public class StopwatchApplication extends LifecycleLoggingApplication { @Override public void onCreate() { super.onCreate(); initDagger(); } private void initDagger() {
// Path: app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java // public abstract class LifecycleLoggingApplication extends Application { // // private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); // // @Override // public void onCreate() { // super....
StopwatchComponent component = DaggerStopwatchComponent.builder()
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/StopwatchApplication.java
// Path: app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java // public abstract class LifecycleLoggingApplication extends Application { // // private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); // // @Override // public void onCreate() { // super....
import com.autonomousapps.LifecycleLoggingApplication; import com.autonomousapps.reactivestopwatch.di.ContextModule; import com.autonomousapps.reactivestopwatch.di.DaggerStopwatchComponent; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.di.StopwatchComponent;
package com.autonomousapps.reactivestopwatch; public class StopwatchApplication extends LifecycleLoggingApplication { @Override public void onCreate() { super.onCreate(); initDagger(); } private void initDagger() { StopwatchComponent component = DaggerStopwatchComponent.build...
// Path: app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java // public abstract class LifecycleLoggingApplication extends Application { // // private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); // // @Override // public void onCreate() { // super....
.contextModule(new ContextModule(this))
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/StopwatchApplication.java
// Path: app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java // public abstract class LifecycleLoggingApplication extends Application { // // private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); // // @Override // public void onCreate() { // super....
import com.autonomousapps.LifecycleLoggingApplication; import com.autonomousapps.reactivestopwatch.di.ContextModule; import com.autonomousapps.reactivestopwatch.di.DaggerStopwatchComponent; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.di.StopwatchComponent;
package com.autonomousapps.reactivestopwatch; public class StopwatchApplication extends LifecycleLoggingApplication { @Override public void onCreate() { super.onCreate(); initDagger(); } private void initDagger() { StopwatchComponent component = DaggerStopwatchComponent.build...
// Path: app/src/main/java/com/autonomousapps/LifecycleLoggingApplication.java // public abstract class LifecycleLoggingApplication extends Application { // // private static final String TAG = LifecycleLoggingApplication.class.getSimpleName(); // // @Override // public void onCreate() { // super....
DaggerUtil.INSTANCE.setComponent(component);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/service/StopwatchService.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.content.Intent; import android.os.IBinder; import android.os.RemoteException; import andro...
package com.autonomousapps.reactivestopwatch.service; public class StopwatchService extends LifecycleLoggingService { private static final String TAG = StopwatchService.class.getSimpleName(); @Inject @Named("local")
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
Stopwatch stopwatch;
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/service/StopwatchService.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.content.Intent; import android.os.IBinder; import android.os.RemoteException; import andro...
package com.autonomousapps.reactivestopwatch.service; public class StopwatchService extends LifecycleLoggingService { private static final String TAG = StopwatchService.class.getSimpleName(); @Inject @Named("local") Stopwatch stopwatch; private final CompositeSubscription subscriptions = new...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
DaggerUtil.INSTANCE.getStopwatchComponent().inject(this);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/service/StopwatchService.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.content.Intent; import android.os.IBinder; import android.os.RemoteException; import andro...
super.onCreate(); DaggerUtil.INSTANCE.getStopwatchComponent().inject(this); } @Override public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); return START_NOT_STICKY; // TODO which? } @Override public v...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
LogUtil.v(TAG + "_lifecycle", "stopSelf()");
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/service/StopwatchService.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.Stopwatch; import android.content.Intent; import android.os.IBinder; import android.os.RemoteException; import andro...
setIsRunning(true); } private void onTick(long tick) { try { listener.onTick(tick); } catch (RemoteException e) { // TODO: more robust error handling LogUtil.e(TAG, "RemoteException calling listener::onTick: " + e.getLo...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
public Lap lap() throws RemoteException {
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/service/LifecycleLoggingService.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import android.app.Service; import android.content.Intent; import android.os.IBinder; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import static com.autonomousapps.common.LogUtil.asString;
package com.autonomousapps.reactivestopwatch.service; public abstract class LifecycleLoggingService extends Service { private static final String TAG = LifecycleLoggingService.class.getSimpleName(); @Override public int onStartCommand(Intent intent, int flags, int startId) {
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
log("onStartCommand(%s, %d, %d)", asString(intent), flags, startId);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/service/LifecycleLoggingService.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import android.app.Service; import android.content.Intent; import android.os.IBinder; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import static com.autonomousapps.common.LogUtil.asString;
super.onDestroy(); log("onDestroy()"); } @Nullable @Override public IBinder onBind(Intent intent) { log("onBind(%s)", asString(intent)); return null; } @Override public boolean onUnbind(Intent intent) { log("onUnbind(%s)", asString(intent)); ...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
LogUtil.v(TAG, msg, args);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/time/StopwatchImpl.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import android.support.annotation.NonNull; import android.support.annotation.VisibleForTesting; import java.util.ArrayList; import java.util.List; import java.util.concurrent.TimeUnit; import javax.inject.Inject; import rx.Observable; import rx.Scheduler; import rx.schedulers.S...
package com.autonomousapps.reactivestopwatch.time; public class StopwatchImpl extends AbstractStopwatch { private static final String TAG = StopwatchImpl.class.getSimpleName(); static final TimeUnit TIME_UNIT = TimeUnit.MILLISECONDS; private Scheduler scheduler = Schedulers.computation(); priv...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
LogUtil.d(TAG, "start(). Returning original Observable");
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/LifecycleLoggingActivity.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import android.app.Activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import static com.autonomousapps.common.LogUtil.asString;
package com.autonomousapps.reactivestopwatch.ui; public abstract class LifecycleLoggingActivity extends Activity { private static final String TAG = LifecycleLoggingActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState)...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
log("onCreate(%s)", asString(savedInstanceState));
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/LifecycleLoggingActivity.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import android.app.Activity; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.annotation.Nullable; import static com.autonomousapps.common.LogUtil.asString;
protected void onRestart() { super.onRestart(); log("onRestart()"); } @Override protected void onResume() { super.onResume(); log("onResume()"); } @Override protected void onPause() { log("onPause()"); super.onPause(); } @Override ...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
LogUtil.v(TAG, msg, args);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/di/PresenterModule.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchMvp.java // public interface StopwatchMvp { // // interface View { // // void onTick(long tick); // // void onStopwatchStarted(); // // void onStopwatchStopped(); // // void onStopwatchReset(); // // ...
import com.autonomousapps.reactivestopwatch.ui.StopwatchMvp; import com.autonomousapps.reactivestopwatch.ui.StopwatchPresenter; import dagger.Binds; import dagger.Module;
package com.autonomousapps.reactivestopwatch.di; @Module(includes = { StopwatchModule.class }) abstract class PresenterModule { @Binds
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchMvp.java // public interface StopwatchMvp { // // interface View { // // void onTick(long tick); // // void onStopwatchStarted(); // // void onStopwatchStopped(); // // void onStopwatchReset(); // // ...
public abstract StopwatchMvp.Presenter bindStopwatchPresenter(StopwatchPresenter stopwatchPresenter);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/di/PresenterModule.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchMvp.java // public interface StopwatchMvp { // // interface View { // // void onTick(long tick); // // void onStopwatchStarted(); // // void onStopwatchStopped(); // // void onStopwatchReset(); // // ...
import com.autonomousapps.reactivestopwatch.ui.StopwatchMvp; import com.autonomousapps.reactivestopwatch.ui.StopwatchPresenter; import dagger.Binds; import dagger.Module;
package com.autonomousapps.reactivestopwatch.di; @Module(includes = { StopwatchModule.class }) abstract class PresenterModule { @Binds
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchMvp.java // public interface StopwatchMvp { // // interface View { // // void onTick(long tick); // // void onStopwatchStarted(); // // void onStopwatchStopped(); // // void onStopwatchReset(); // // ...
public abstract StopwatchMvp.Presenter bindStopwatchPresenter(StopwatchPresenter stopwatchPresenter);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/time/RemoteStopwatch.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import com.autonomousapps.reactivestopwatch.service.IStopwatchService; import com.autonomousapps.reactivestopwatch.service.IStopwatchTickListener; import com.autonomousapps.reactivestopwatch.service.StopwatchService; import android.content.ComponentName; import android.content....
package com.autonomousapps.reactivestopwatch.time; // Inspiration from http://www.donnfelker.com/rxjava-with-aidl-services/ // This also represents an implementation of the Adapter pattern. public class RemoteStopwatch implements Stopwatch { private static final String TAG = RemoteStopwatch.class.getSimpleNam...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
Intent serviceIntent = new Intent(context, StopwatchService.class);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/time/RemoteStopwatch.java
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
import com.autonomousapps.common.LogUtil; import com.autonomousapps.reactivestopwatch.service.IStopwatchService; import com.autonomousapps.reactivestopwatch.service.IStopwatchTickListener; import com.autonomousapps.reactivestopwatch.service.StopwatchService; import android.content.ComponentName; import android.content....
@Inject RemoteStopwatch(@NonNull Context context) { this.context = context; subscriptions = new CompositeSubscription(); startService(); } // I want the service to continue running even when unbound, so I start it first private void startService() { Intent serviceIn...
// Path: app/src/main/java/com/autonomousapps/common/LogUtil.java // public class LogUtil { // // public static void v(@NonNull String tag, @NonNull String msg, @Nullable Object... args) { // Log.v(tag, String.format(msg, args)); // } // // public static void d(@NonNull String tag, @NonNull String...
LogUtil.d(TAG, "onServiceConnected()");
autonomousapps/ReactiveStopwatch
app/src/androidTest/java/com/autonomousapps/reactivestopwatch/di/TestModule.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Stopwatch.java // public interface Stopwatch extends AutoCloseable { // // /** // * TODO // */ // void onUiShown(); // // /** // * TODO // */ // void onUiHidden(); // // /** // * Starts the stopwatch. //...
import com.autonomousapps.reactivestopwatch.time.Stopwatch; import com.autonomousapps.reactivestopwatch.ui.StopwatchMvp; import javax.inject.Named; import dagger.Module; import dagger.Provides; import static org.mockito.Mockito.mock;
package com.autonomousapps.reactivestopwatch.di; @Module class TestModule {
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Stopwatch.java // public interface Stopwatch extends AutoCloseable { // // /** // * TODO // */ // void onUiShown(); // // /** // * TODO // */ // void onUiHidden(); // // /** // * Starts the stopwatch. //...
private final StopwatchMvp.Presenter mockStopwatchPresenter;
autonomousapps/ReactiveStopwatch
app/src/androidTest/java/com/autonomousapps/reactivestopwatch/di/TestModule.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Stopwatch.java // public interface Stopwatch extends AutoCloseable { // // /** // * TODO // */ // void onUiShown(); // // /** // * TODO // */ // void onUiHidden(); // // /** // * Starts the stopwatch. //...
import com.autonomousapps.reactivestopwatch.time.Stopwatch; import com.autonomousapps.reactivestopwatch.ui.StopwatchMvp; import javax.inject.Named; import dagger.Module; import dagger.Provides; import static org.mockito.Mockito.mock;
package com.autonomousapps.reactivestopwatch.di; @Module class TestModule { private final StopwatchMvp.Presenter mockStopwatchPresenter;
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Stopwatch.java // public interface Stopwatch extends AutoCloseable { // // /** // * TODO // */ // void onUiShown(); // // /** // * TODO // */ // void onUiHidden(); // // /** // * Starts the stopwatch. //...
private final Stopwatch mockStopwatch;
autonomousapps/ReactiveStopwatch
app/src/test/java/com/autonomousapps/reactivestopwatch/ui/StopwatchPresenterTest.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
import com.autonomousapps.reactivestopwatch.mvp.ViewNotAttachedException; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.time.StopwatchImpl; import org.junit.After; import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock...
package com.autonomousapps.reactivestopwatch.ui; @RunWith(MockitoJUnitRunner.class) public class StopwatchPresenterTest {
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/mvp/ViewNotAttachedException.java // public class ViewNotAttachedException extends RuntimeException { // } // // Path: app/src/main/java/com/autonomousapps/reactivestopwatch/time/Lap.java // @AutoValue // public abstract class Lap implements Parcelable { ...
@Mock StopwatchImpl stopwatch;
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchFragment.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
import com.autonomousapps.reactivestopwatch.R; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.NonNull; i...
package com.autonomousapps.reactivestopwatch.ui; public class StopwatchFragment extends Fragment implements StopwatchMvp.View { public static String TAG = StopwatchFragment.class.getSimpleName(); @BindView(R.id.stopwatch)
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
TimeTeller timeTeller;
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchFragment.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
import com.autonomousapps.reactivestopwatch.R; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.NonNull; i...
package com.autonomousapps.reactivestopwatch.ui; public class StopwatchFragment extends Fragment implements StopwatchMvp.View { public static String TAG = StopwatchFragment.class.getSimpleName(); @BindView(R.id.stopwatch) TimeTeller timeTeller; @BindView(R.id.btn_reset_lap) Button resetLapBu...
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
DaggerUtil.INSTANCE.getStopwatchComponent().inject(this);
autonomousapps/ReactiveStopwatch
app/src/main/java/com/autonomousapps/reactivestopwatch/ui/StopwatchFragment.java
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
import com.autonomousapps.reactivestopwatch.R; import com.autonomousapps.reactivestopwatch.di.DaggerUtil; import com.autonomousapps.reactivestopwatch.time.Lap; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import android.app.Fragment; import android.os.Bundle; import android.support.annotation.NonNull; i...
private long lastTimeLogged = -1L; // Because of backpressure, this will log AT MOST every second private void logEverySecond(long timeInMillis) { // TODO use TimeUnit instead of assuming callers are passing correct units? if (timeInMillis % 1000L == 0L && timeInMillis != lastTimeLogged) { ...
// Path: app/src/main/java/com/autonomousapps/reactivestopwatch/di/DaggerUtil.java // public enum DaggerUtil { // INSTANCE; // // private StopwatchComponent stopwatchComponent; // // @NonNull // public StopwatchComponent getStopwatchComponent() { // checkNotNull(); // return stopwatchC...
public void onNewLap(@NonNull Lap lap) {
autonomousapps/ReactiveStopwatch
app/src/androidTest/java/com/autonomousapps/reactivestopwatch/ui/StopwatchFragmentTest.java
// Path: app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractMockedDependenciesTest.java // public abstract class AbstractMockedDependenciesTest extends AbstractAnimationDisablingTest { // // protected TestStopwatchComponent testComponent; // // @Before // @CallSuper // public v...
import com.autonomousapps.reactivestopwatch.R; import com.autonomousapps.reactivestopwatch.test.AbstractMockedDependenciesTest; import com.autonomousapps.reactivestopwatch.test.annotations.CommitStage; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import org.junit.Before; import org.junit.Rule; import or...
package com.autonomousapps.reactivestopwatch.ui; @CommitStage public class StopwatchFragmentTest extends AbstractMockedDependenciesTest { private static final String START_TEXT = "start"; private static final String STOP_TEXT = "stop"; private static final String RESET_TEXT = "reset"; private st...
// Path: app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractMockedDependenciesTest.java // public abstract class AbstractMockedDependenciesTest extends AbstractAnimationDisablingTest { // // protected TestStopwatchComponent testComponent; // // @Before // @CallSuper // public v...
private TimeTeller mockTimeTeller;
autonomousapps/ReactiveStopwatch
app/src/androidTest/java/com/autonomousapps/reactivestopwatch/ui/StopwatchFragmentTest.java
// Path: app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractMockedDependenciesTest.java // public abstract class AbstractMockedDependenciesTest extends AbstractAnimationDisablingTest { // // protected TestStopwatchComponent testComponent; // // @Before // @CallSuper // public v...
import com.autonomousapps.reactivestopwatch.R; import com.autonomousapps.reactivestopwatch.test.AbstractMockedDependenciesTest; import com.autonomousapps.reactivestopwatch.test.annotations.CommitStage; import com.autonomousapps.reactivestopwatch.view.TimeTeller; import org.junit.Before; import org.junit.Rule; import or...
private void setupMockView() { doAnswer(invocation -> view = (StopwatchMvp.View) invocation.getArguments()[0]) .when(stopwatchPresenter).attachView(any(StopwatchMvp.View.class)); doAnswer(invocation -> view = null) .when(stopwatchPresenter).detachView(); } pr...
// Path: app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractMockedDependenciesTest.java // public abstract class AbstractMockedDependenciesTest extends AbstractAnimationDisablingTest { // // protected TestStopwatchComponent testComponent; // // @Before // @CallSuper // public v...
verifyViewIsDisplayedWithTextIgnoreCase(STOP_TEXT);
autonomousapps/ReactiveStopwatch
app/src/androidTest/java/com/autonomousapps/reactivestopwatch/ui/StopwatchAcceptanceTest.java
// Path: app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractAnimationDisablingTest.java // public abstract class AbstractAnimationDisablingTest { // // @BeforeClass // public static void disableAnimations() { // SystemAnimations.disableAll(InstrumentationRegistry.getTargetContex...
import com.autonomousapps.reactivestopwatch.test.AbstractAnimationDisablingTest; import com.autonomousapps.reactivestopwatch.test.Timer; import com.autonomousapps.reactivestopwatch.test.annotations.AcceptanceStage; import org.junit.After; import org.junit.Before; import org.junit.Test; import android.content.Context; i...
Intent intent = context.getPackageManager().getLaunchIntentForPackage(APPLICATION_PACKAGE); // intent.addFlags(Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT); return intent; } /* * Uses package manager to find the package name of the device launcher. Usually this package * is "com.andr...
// Path: app/src/androidTest/java/com/autonomousapps/reactivestopwatch/test/AbstractAnimationDisablingTest.java // public abstract class AbstractAnimationDisablingTest { // // @BeforeClass // public static void disableAnimations() { // SystemAnimations.disableAll(InstrumentationRegistry.getTargetContex...
Timer timer = new Timer();
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/utils/LocationUtils.java
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // }
import android.location.Location; import com.vehiclerental.contracts.BranchContract; import java.util.List; import io.nlopez.smartlocation.location.providers.LocationGooglePlayServicesProvider;
/** * CarRental * * This file provides multiple location abstraction methods in order to get the nearest branch to the user */ package com.vehiclerental.utils; public class LocationUtils { //Constants used in the calculation private final static double EARTH_RADIUS_IN_KM = 6371; /** * Retur...
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // Path: app/src/main/java/com/vehiclerental/utils/LocationUtils.java import android.location...
public static BranchContract getNearestBranch(Location currentLocation, List<BranchContract> branchContractList) {
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/apiClient/socketImplementation/SocketClient.java
// Path: app/src/main/java/com/vehiclerental/CarRentalApplication.java // public class CarRentalApplication extends Application { // // //Static access to context and ssl parameters // private static Application application; // private static SSLContext sslContext; // // /** // * Returns the curr...
import com.google.gson.Gson; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.vehiclerental.CarRentalApplication; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import javax.net.ssl.SSLSocket;
/** * CarRental * * This file provides an abstraction of the native secure socket client */ package com.vehiclerental.apiClient.socketImplementation; public class SocketClient { /** * Process given request and return results * * @param url the server url * @param port the server port ...
// Path: app/src/main/java/com/vehiclerental/CarRentalApplication.java // public class CarRentalApplication extends Application { // // //Static access to context and ssl parameters // private static Application application; // private static SSLContext sslContext; // // /** // * Returns the curr...
socket = (SSLSocket) CarRentalApplication.getSslContext().getSocketFactory().createSocket(url, port);
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/utils/StaticDataUtils.java
// Path: app/src/main/java/com/vehiclerental/CarRentalApplication.java // public class CarRentalApplication extends Application { // // //Static access to context and ssl parameters // private static Application application; // private static SSLContext sslContext; // // /** // * Returns the curr...
import com.vehiclerental.R; import com.vehiclerental.CarRentalApplication; import com.vehiclerental.contracts.BranchContract; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
/** * CarRental * * This file provides a simple access to all the static (or nearly static) data of the system * * This includes: * - The vehicle types * - The vehicle statuses * - The branch list (which is only loaded once) */ package com.vehiclerental.utils; public class StaticDataUtils { //Data str...
// Path: app/src/main/java/com/vehiclerental/CarRentalApplication.java // public class CarRentalApplication extends Application { // // //Static access to context and ssl parameters // private static Application application; // private static SSLContext sslContext; // // /** // * Returns the curr...
private static Map<String, BranchContract> branchContractMap;
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/utils/StaticDataUtils.java
// Path: app/src/main/java/com/vehiclerental/CarRentalApplication.java // public class CarRentalApplication extends Application { // // //Static access to context and ssl parameters // private static Application application; // private static SSLContext sslContext; // // /** // * Returns the curr...
import com.vehiclerental.R; import com.vehiclerental.CarRentalApplication; import com.vehiclerental.contracts.BranchContract; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
/** * CarRental * * This file provides a simple access to all the static (or nearly static) data of the system * * This includes: * - The vehicle types * - The vehicle statuses * - The branch list (which is only loaded once) */ package com.vehiclerental.utils; public class StaticDataUtils { //Data str...
// Path: app/src/main/java/com/vehiclerental/CarRentalApplication.java // public class CarRentalApplication extends Application { // // //Static access to context and ssl parameters // private static Application application; // private static SSLContext sslContext; // // /** // * Returns the curr...
vehicleTypes.add(0, CarRentalApplication.getAppContext().getString(R.string.small_car_type));
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/preferences/PreferencesManager.java
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // // Path: app/src/main/java/com/vehiclerental/contracts/UserContract.java // public class Us...
import android.content.Context; import android.content.SharedPreferences; import android.hardware.camera2.params.StreamConfigurationMap; import android.preference.PreferenceManager; import com.vehiclerental.contracts.BranchContract; import com.vehiclerental.contracts.UserContract; import com.vehiclerental.utils.Seriali...
/** * CarRental * * This file provides preference manager, it is an abstraction layer for the SharedPreferences system, which also provides an in-memory cache * * At the moment the file is not too large, but if more preferences were to be added, other files should be created to avoid a bloated class */ package c...
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // // Path: app/src/main/java/com/vehiclerental/contracts/UserContract.java // public class Us...
private static UserContract currentUser;
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/preferences/PreferencesManager.java
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // // Path: app/src/main/java/com/vehiclerental/contracts/UserContract.java // public class Us...
import android.content.Context; import android.content.SharedPreferences; import android.hardware.camera2.params.StreamConfigurationMap; import android.preference.PreferenceManager; import com.vehiclerental.contracts.BranchContract; import com.vehiclerental.contracts.UserContract; import com.vehiclerental.utils.Seriali...
/** * CarRental * * This file provides preference manager, it is an abstraction layer for the SharedPreferences system, which also provides an in-memory cache * * At the moment the file is not too large, but if more preferences were to be added, other files should be created to avoid a bloated class */ package c...
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // // Path: app/src/main/java/com/vehiclerental/contracts/UserContract.java // public class Us...
private static BranchContract currentBranch;
AlexisChevalier/CarRental-Android-Application
app/src/main/java/com/vehiclerental/preferences/PreferencesManager.java
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // // Path: app/src/main/java/com/vehiclerental/contracts/UserContract.java // public class Us...
import android.content.Context; import android.content.SharedPreferences; import android.hardware.camera2.params.StreamConfigurationMap; import android.preference.PreferenceManager; import com.vehiclerental.contracts.BranchContract; import com.vehiclerental.contracts.UserContract; import com.vehiclerental.utils.Seriali...
/** * CarRental * * This file provides preference manager, it is an abstraction layer for the SharedPreferences system, which also provides an in-memory cache * * At the moment the file is not too large, but if more preferences were to be added, other files should be created to avoid a bloated class */ package c...
// Path: app/src/main/java/com/vehiclerental/contracts/BranchContract.java // public class BranchContract { // public int id; // public String name; // public double latitude; // public double longitude; // } // // Path: app/src/main/java/com/vehiclerental/contracts/UserContract.java // public class Us...
editor.putString(PREF_BRANCH_LABEL, SerializationUtils.serialize(contract));