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 |
|---|---|---|---|---|---|---|
jnoessner/rockIt | src/main/java/com/googlecode/rockit/javaAPI/predicates/Predicate.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.util.ArrayList;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.javaAPI.types.Type; | package com.googlecode.rockit.javaAPI.predicates;
public class Predicate extends PredicateAbstract
{
public Predicate()
{
}
| // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | public Predicate(String name, boolean hidden, Type... types) throws ParseException |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/javaAPI/formulas/FormulaAbstract.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.util.ArrayList;
import java.util.HashSet;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.javaAPI.formulas.expressions.IfExpression;
import com.googlecode.rockit.javaAPI.formulas.expressions.impl.PredicateExpression;
import com.googlecode.rockit.javaAPI.formulas.variables... | package com.googlecode.rockit.javaAPI.formulas;
/**
* The basic class of all formular.
*
* Defines the For- and the If-part of every formular.
*
* @author jan
*
*/
public abstract class FormulaAbstract implements Comparable<FormulaAbstract>
{ | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | private HashSet<VariableType> forVariables = new HashSet<VariableType>(); |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/app/solver/aggregate/simple/AggregatedConstraint.java | // Path: src/main/java/com/googlecode/rockit/app/solver/pojo/Literal.java
// public class Literal
// {
// private boolean positive;
// private String name;
// // private GRBVar var;
// private int id = -1;
//
//
// public Literal()
// {
// }
//
//
// public Literal(String name, ... | import java.util.ArrayList;
import com.googlecode.rockit.app.solver.pojo.Literal;
import com.googlecode.rockit.conn.ilp.ILPConnector;
import com.googlecode.rockit.exception.ILPException; | package com.googlecode.rockit.app.solver.aggregate.simple;
public class AggregatedConstraint
{
private String id; | // Path: src/main/java/com/googlecode/rockit/app/solver/pojo/Literal.java
// public class Literal
// {
// private boolean positive;
// private String name;
// // private GRBVar var;
// private int id = -1;
//
//
// public Literal()
// {
// }
//
//
// public Literal(String name, ... | private ArrayList<Literal> aggregatedVars = new ArrayList<Literal>(); |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/app/solver/aggregate/simple/AggregatedConstraint.java | // Path: src/main/java/com/googlecode/rockit/app/solver/pojo/Literal.java
// public class Literal
// {
// private boolean positive;
// private String name;
// // private GRBVar var;
// private int id = -1;
//
//
// public Literal()
// {
// }
//
//
// public Literal(String name, ... | import java.util.ArrayList;
import com.googlecode.rockit.app.solver.pojo.Literal;
import com.googlecode.rockit.conn.ilp.ILPConnector;
import com.googlecode.rockit.exception.ILPException; | package com.googlecode.rockit.app.solver.aggregate.simple;
public class AggregatedConstraint
{
private String id;
private ArrayList<Literal> aggregatedVars = new ArrayList<Literal>();
private ArrayList<Literal> singleVars = new ArrayList<Literal>();
private double weight... | // Path: src/main/java/com/googlecode/rockit/app/solver/pojo/Literal.java
// public class Literal
// {
// private boolean positive;
// private String name;
// // private GRBVar var;
// private int id = -1;
//
//
// public Literal()
// {
// }
//
//
// public Literal(String name, ... | public void addConstraintAndDeleteOldOne(ILPConnector con) throws ILPException |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/test/MiniTestApplication.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.io.IOException;
import java.sql.SQLException;
import org.antlr.runtime.RecognitionException;
import com.googlecode.rockit.app.Main;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.exception.ReadOrWriteToFileException;
import com.googlecode.rockit.exception.SolveException; | package com.googlecode.rockit.test;
public class MiniTestApplication
{
/**
* @param args
* @throws ReadOrWriteToFileException
* @throws SQLException
* @throws SolveException
* @throws RecognitionException
* @throws ParseException
* @throws IOException
*/ | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | public static void main(String[] args) throws IOException, ParseException, RecognitionException, SolveException, SQLException, ReadOrWriteToFileException |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/test/MiniTestApplication.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.io.IOException;
import java.sql.SQLException;
import org.antlr.runtime.RecognitionException;
import com.googlecode.rockit.app.Main;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.exception.ReadOrWriteToFileException;
import com.googlecode.rockit.exception.SolveException; | package com.googlecode.rockit.test;
public class MiniTestApplication
{
/**
* @param args
* @throws ReadOrWriteToFileException
* @throws SQLException
* @throws SolveException
* @throws RecognitionException
* @throws ParseException
* @throws IOException
*/ | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | public static void main(String[] args) throws IOException, ParseException, RecognitionException, SolveException, SQLException, ReadOrWriteToFileException |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/javaAPI/formulas/FormulaObjective.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.util.ArrayList;
import java.util.HashSet;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.javaAPI.formulas.expressions.IfExpression;
import com.googlecode.rockit.javaAPI.formulas.expressions.impl.PredicateExpression;
import com.googlecode.rockit.javaAPI.formulas.variables... | package com.googlecode.rockit.javaAPI.formulas;
/**
* Formular with only 1 positive literal assigned with a double weight.
*
* @author jan
*
*/
public class FormulaObjective extends FormulaAbstract
{ | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | private VariableDouble doubleVariable; |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/javaAPI/formulas/FormulaObjective.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.util.ArrayList;
import java.util.HashSet;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.javaAPI.formulas.expressions.IfExpression;
import com.googlecode.rockit.javaAPI.formulas.expressions.impl.PredicateExpression;
import com.googlecode.rockit.javaAPI.formulas.variables... | package com.googlecode.rockit.javaAPI.formulas;
/**
* Formular with only 1 positive literal assigned with a double weight.
*
* @author jan
*
*/
public class FormulaObjective extends FormulaAbstract
{
private VariableDouble doubleVariable;
private PredicateExpression objectiveExpression;
priv... | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | public FormulaObjective(String name, HashSet<VariableType> forVariables, ArrayList<IfExpression> ifExpressions, VariableDouble doubleVariable, PredicateExpression objectiveExpression) throws ParseException |
jnoessner/rockIt | src/main/java/com/googlecode/rockit/javaAPI/formulas/FormulaObjective.java | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | import java.util.ArrayList;
import java.util.HashSet;
import com.googlecode.rockit.exception.ParseException;
import com.googlecode.rockit.javaAPI.formulas.expressions.IfExpression;
import com.googlecode.rockit.javaAPI.formulas.expressions.impl.PredicateExpression;
import com.googlecode.rockit.javaAPI.formulas.variables... | package com.googlecode.rockit.javaAPI.formulas;
/**
* Formular with only 1 positive literal assigned with a double weight.
*
* @author jan
*
*/
public class FormulaObjective extends FormulaAbstract
{
private VariableDouble doubleVariable;
private PredicateExpression objectiveExpression;
priv... | // Path: src/main/java/com/googlecode/rockit/exception/ParseException.java
// public class ParseException extends Exception
// {
//
// /**
// * Exceptions which can occur in the Parse Phase of the application.
// */
// private static final long serialVersionUID = -4390051337485101364L;
//
//
// ... | public FormulaObjective(String name, HashSet<VariableType> forVariables, ArrayList<IfExpression> ifExpressions, VariableDouble doubleVariable, PredicateExpression objectiveExpression) throws ParseException |
SecUSo/privacy-friendly-weather | app/src/test/java/org/secuso/privacyfriendlyweather/TimeTest.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/util/TimeUtil.java
// public class TimeUtil {
// private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm", Locale.getDefault());
//
// public static long getStartOfDay(int timezoneInSeconds) {
// return getStartOfDayCustomCur... | import org.junit.Test;
import org.secuso.privacyfriendlyweather.util.TimeUtil;
import java.sql.Time;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; | package org.secuso.privacyfriendlyweather;
/**
* To work on unit tests, switch the Test Artifact in the Build Variants view.
*/
public class TimeTest {
@Test
public void testTimeStartOfDay() {
long currentTime = 1599659833857L; | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/util/TimeUtil.java
// public class TimeUtil {
// private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm", Locale.getDefault());
//
// public static long getStartOfDay(int timezoneInSeconds) {
// return getStartOfDayCustomCur... | long startOfDay = TimeUtil.getStartOfDayCustomCurrentTime(3 * 3600, currentTime); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForForecast.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForForecast; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* This class provides the functionality for making and processing HTTP requests to the
* OpenWeatherMap to retrieve the latest weather data for all stored cities.
*/
public class OwmHttpRequestForForecast extends OwmHttpRequest implements... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | IHttpRequest httpRequest = new VolleyHttpRequest(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForForecast.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForForecast; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* This class provides the functionality for making and processing HTTP requests to the
* OpenWeatherMap to retrieve the latest weather data for all stored cities.
*/
public class OwmHttpRequestForForecast extends OwmHttpRequest implements... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | IHttpRequest httpRequest = new VolleyHttpRequest(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForForecast.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForForecast; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* This class provides the functionality for making and processing HTTP requests to the
* OpenWeatherMap to retrieve the latest weather data for all stored cities.
*/
public class OwmHttpRequestForForecast extends OwmHttpRequest implements... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | httpRequest.make(URL, HttpRequestType.GET, new ProcessOwmForecastRequest(context)); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/activities/HelpActivity.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/ui/Help/ExpandableListAdapter.java
// public class ExpandableListAdapter extends BaseExpandableListAdapter {
//
// private Context context;
// private List<String> expandableListTitle;
// private HashMap<String, List<String>> expandableListDetail... | import android.os.Bundle;
import android.widget.ExpandableListView;
import org.secuso.privacyfriendlyweather.R;
import org.secuso.privacyfriendlyweather.ui.Help.ExpandableListAdapter;
import org.secuso.privacyfriendlyweather.ui.Help.HelpDataDump;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.u... | package org.secuso.privacyfriendlyweather.activities;
/**
* Created by yonjuni on 17.06.16.
*/
public class HelpActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help); | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/ui/Help/ExpandableListAdapter.java
// public class ExpandableListAdapter extends BaseExpandableListAdapter {
//
// private Context context;
// private List<String> expandableListTitle;
// private HashMap<String, List<String>> expandableListDetail... | ExpandableListAdapter expandableListAdapter; |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/activities/HelpActivity.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/ui/Help/ExpandableListAdapter.java
// public class ExpandableListAdapter extends BaseExpandableListAdapter {
//
// private Context context;
// private List<String> expandableListTitle;
// private HashMap<String, List<String>> expandableListDetail... | import android.os.Bundle;
import android.widget.ExpandableListView;
import org.secuso.privacyfriendlyweather.R;
import org.secuso.privacyfriendlyweather.ui.Help.ExpandableListAdapter;
import org.secuso.privacyfriendlyweather.ui.Help.HelpDataDump;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.u... | package org.secuso.privacyfriendlyweather.activities;
/**
* Created by yonjuni on 17.06.16.
*/
public class HelpActivity extends BaseActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_help);
... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/ui/Help/ExpandableListAdapter.java
// public class ExpandableListAdapter extends BaseExpandableListAdapter {
//
// private Context context;
// private List<String> expandableListTitle;
// private HashMap<String, List<String>> expandableListDetail... | HelpDataDump helpDataDump = new HelpDataDump(this); |
SecUSo/privacy-friendly-weather | app/src/androidTest/java/org/secuso/privacyfriendlyweather/database/DatabaseTest.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/City.java
// @Entity(tableName = "CITIES", indices = {@Index(value = {"city_name", "cities_id"})})
// public class City {
//
// private static final String UNKNOWN_POSTAL_CODE_VALUE = "-";
//
// @PrimaryKey @ColumnInfo(name = "cities_i... | import android.content.Context;
import androidx.room.Room;
import androidx.room.testing.MigrationTestHelper;
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Assert;
imp... | package org.secuso.privacyfriendlyweather.database;
@RunWith(AndroidJUnit4.class)
public class DatabaseTest {
private static final String TAG = "AppTest";
private static final Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext();
private static final Context testContex... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/City.java
// @Entity(tableName = "CITIES", indices = {@Index(value = {"city_name", "cities_id"})})
// public class City {
//
// private static final String UNKNOWN_POSTAL_CODE_VALUE = "-";
//
// @PrimaryKey @ColumnInfo(name = "cities_i... | appContext.getDatabasePath(DB_NAME).delete(); |
SecUSo/privacy-friendly-weather | app/src/androidTest/java/org/secuso/privacyfriendlyweather/database/DatabaseTest.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/City.java
// @Entity(tableName = "CITIES", indices = {@Index(value = {"city_name", "cities_id"})})
// public class City {
//
// private static final String UNKNOWN_POSTAL_CODE_VALUE = "-";
//
// @PrimaryKey @ColumnInfo(name = "cities_i... | import android.content.Context;
import androidx.room.Room;
import androidx.room.testing.MigrationTestHelper;
import androidx.sqlite.db.framework.FrameworkSQLiteOpenHelperFactory;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import androidx.test.platform.app.InstrumentationRegistry;
import org.junit.Assert;
imp... |
// init database
dbHandler.getAllCitiesToWatch();
dbHandler.close();
// migration
testHelper.runMigrationsAndValidate("PF_WEATHER_DB_4.db", AppDatabase.VERSION, true, AppDatabase.getMigrations(appContext));
AppDatabase appDatabase = Room.databaseBuilder(appContext, App... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/City.java
// @Entity(tableName = "CITIES", indices = {@Index(value = {"city_name", "cities_id"})})
// public class City {
//
// private static final String UNKNOWN_POSTAL_CODE_VALUE = "-";
//
// @PrimaryKey @ColumnInfo(name = "cities_i... | List<City> possibleCities = appDatabase.cityDao().getCitiesWhereNameLike("Frankfurt", 10); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/database/dao/CityToWatchDao.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/CityToWatch.java
// @SuppressWarnings({RoomWarnings.PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED,
// RoomWarnings.MISSING_INDEX_ON_FOREIGN_KEY_CHILD, RoomWarnings.INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED})
//
// /**
// * This class is the databas... | import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;
import org.secuso.privacyfriendlyweather.database.data.CityToWatch;
import java.util.List; | package org.secuso.privacyfriendlyweather.database.dao;
/**
* @author Christopher Beckmann
*/
@Dao
public interface CityToWatchDao {
@Query("SELECT * FROM CITIES_TO_WATCH") | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/CityToWatch.java
// @SuppressWarnings({RoomWarnings.PRIMARY_KEY_FROM_EMBEDDED_IS_DROPPED,
// RoomWarnings.MISSING_INDEX_ON_FOREIGN_KEY_CHILD, RoomWarnings.INDEX_FROM_EMBEDDED_ENTITY_IS_DROPPED})
//
// /**
// * This class is the databas... | List<CityToWatch> getAll(); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/database/data/Forecast.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | import android.content.Context;
import android.widget.Toast;
import androidx.room.ColumnInfo;
import androidx.room.Embedded;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import androidx.room.RoomWarnings;
import org.secuso.privacyfriendlywea... | public float getWindSpeed() {
return windSpeed;
}
public void setWindSpeed(float speed) {
windSpeed = speed;
}
/**
* @return Returns the ID of the record (which uniquely identifies the record).
*/
public int getId() {
return id;
}
public void setId(in... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | AppDatabase dbhelper = AppDatabase.getInstance(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/http/VolleyHttpRequest.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/IProcessHttpRequest.java
// public interface IProcessHttpRequest {
//
// /**
// * The method that will be executed in case of a successful HTTP request.
// *
// * @param response The response of the HTTP request.
// */
// ... | import android.content.Context;
import android.util.Log;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.HurlStack;
import com.android.volley.toolbox.StringRequest;
import com.android.... | package org.secuso.privacyfriendlyweather.http;
/**
* This class implements the IHttpRequest interface. It provides HTTP requests by using Volley.
* See: https://developer.android.com/training/volley/simple.html
*/
public class VolleyHttpRequest implements IHttpRequest {
private Context context;
/**
... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/IProcessHttpRequest.java
// public interface IProcessHttpRequest {
//
// /**
// * The method that will be executed in case of a successful HTTP request.
// *
// * @param response The response of the HTTP request.
// */
// ... | public void make(String URL, HttpRequestType method, final IProcessHttpRequest requestProcessor) { |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/backup/BackupRestorer.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.preference.PreferenceManager;
import android.util.JsonReader;
import androidx.annotation.NonNull;
import org.jetbrains.annotations.NotNull;
import org.secuso.privacyfriendlybackup.api.... | break;
case "last_used_key":
case "shared_calls_used":
pref.edit().putInt(name, reader.nextInt()).apply();
break;
case "shared_calls_count_start":
pref.edit().putLong(name, reader.nextLong()).... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | AppDatabase database = AppDatabase.getInstance(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/backup/BackupCreator.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// public static final String DB_NAME = "PF_WEATHER_DB.db";
| import android.content.Context;
import android.content.SharedPreferences;
import android.database.sqlite.SQLiteDatabase;
import android.preference.PreferenceManager;
import android.util.JsonWriter;
import android.util.Log;
import org.jetbrains.annotations.NotNull;
import org.secuso.privacyfriendlybackup.api.backup.Data... | package org.secuso.privacyfriendlyweather.backup;
public class BackupCreator implements IBackupCreator {
@Override
public void writeBackup(@NotNull Context context, @NotNull OutputStream outputStream) {
// lock application, so no changes can be made as long as this backup is created
// depending o... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// public static final String DB_NAME = "PF_WEATHER_DB.db";
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/backup/BackupCreator.java
import android.content.Context;
import android.content.SharedPreferences;
import and... | SQLiteDatabase dataBase = SQLiteDatabase.openDatabase(context.getDatabasePath(DB_NAME).getPath(), null, SQLiteDatabase.OPEN_READONLY); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/database/data/WeekForecast.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | import android.content.Context;
import androidx.room.ColumnInfo;
import androidx.room.Embedded;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Ignore;
import androidx.room.PrimaryKey;
import androidx.room.RoomWarnings;
import org.secuso.privacyfriendlyweather.database.AppDatabase; | this.precipitation = precipitation;
this.wind_speed = wind_speed;
this.wind_direction = wind_direction;
this.uv_index = uv_index;
this.rain_probability = rain_probability;
}
/**
* @return Returns the ID of the record (which uniquely identifies the record).
*/
... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | AppDatabase dbhelper = AppDatabase.getInstance(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/database/migration/Migration_4_5.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | import android.content.Context;
import androidx.annotation.NonNull;
import androidx.sqlite.db.SupportSQLiteDatabase;
import org.secuso.privacyfriendlyweather.database.AppDatabase; | package org.secuso.privacyfriendlyweather.database.migration;
/**
* Migration from version 4 to 5. This is the migration from regular SQLite to Room.
* That is why a lot of changes had to be done here. Some tables had wrong entry types and the city list was updated.
* Because this was the case for every table, e... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/AppDatabase.java
// @Database(entities = {City.class, CityToWatch.class, CurrentWeatherData.class, Forecast.class, WeekForecast.class}, version = AppDatabase.VERSION)
// public abstract class AppDatabase extends RoomDatabase {
// public static fi... | AppDatabase.fillCityDatabase(context, database); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForRadiusSearch.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForRadiusSearch; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* Implementation for the OpenWeatherMap API.
*/
public class OwmHttpRequestForRadiusSearch extends OwmHttpRequest implements IHttpRequestForRadiusSearch {
/**
* Member variables
*/
private Context context;
/**
... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | IHttpRequest httpRequest = new VolleyHttpRequest(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForRadiusSearch.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForRadiusSearch; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* Implementation for the OpenWeatherMap API.
*/
public class OwmHttpRequestForRadiusSearch extends OwmHttpRequest implements IHttpRequestForRadiusSearch {
/**
* Member variables
*/
private Context context;
/**
... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | IHttpRequest httpRequest = new VolleyHttpRequest(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/preferences/AppPreferencesManager.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/ui/Help/StringFormatUtils.java
// public final class StringFormatUtils {
//
// private static DecimalFormat decimalFormat = new DecimalFormat("0.0");
// private static DecimalFormat intFormat = new DecimalFormat("0");
//
// public static String ... | import android.content.Context;
import android.content.SharedPreferences;
import androidx.appcompat.app.AppCompatDelegate;
import org.secuso.privacyfriendlyweather.BuildConfig;
import org.secuso.privacyfriendlyweather.R;
import org.secuso.privacyfriendlyweather.ui.Help.StringFormatUtils; | break;
case 3:
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_NO);
break;
}
}
/**
* @return Returns speed unit abbreviations
*/
public String getSpeedUnit() {
int prefValue = Integer.parseInt(preferenc... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/ui/Help/StringFormatUtils.java
// public final class StringFormatUtils {
//
// private static DecimalFormat decimalFormat = new DecimalFormat("0.0");
// private static DecimalFormat intFormat = new DecimalFormat("0");
//
// public static String ... | return StringFormatUtils.formatDecimal(speedInMetersPerSecond * 3.6f, "km/h"); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/ui/AreYouSureFragment.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/activities/CreateKeyActivity.java
// public class CreateKeyActivity extends AppCompatActivity {
//
// public static boolean active = false;
//
// RelativeLayout layout;
// EditText personalKeyField;
// Button keyButton;
// Button abortBu... | import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.fragment.app.Fragment;
import org.secuso.privacyfriendlyweather.R;
import org.secu... | package org.secuso.privacyfriendlyweather.ui;
public class AreYouSureFragment extends Fragment {
Button shared;
Button personal;
@Nullable
@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
return i... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/activities/CreateKeyActivity.java
// public class CreateKeyActivity extends AppCompatActivity {
//
// public static boolean active = false;
//
// RelativeLayout layout;
// EditText personalKeyField;
// Button keyButton;
// Button abortBu... | ((CreateKeyActivity) getActivity()).leave(); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForOneCallAPI.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForOneCallAPI; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* This class provides the functionality for making and processing HTTP requests to the
* OpenWeatherMap to retrieve the latest weather data for all stored cities.
*/
public class OwmHttpRequestForOneCallAPI extends OwmHttpRequest implemen... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | IHttpRequest httpRequest = new VolleyHttpRequest(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForOneCallAPI.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForOneCallAPI; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* This class provides the functionality for making and processing HTTP requests to the
* OpenWeatherMap to retrieve the latest weather data for all stored cities.
*/
public class OwmHttpRequestForOneCallAPI extends OwmHttpRequest implemen... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | IHttpRequest httpRequest = new VolleyHttpRequest(context); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/weather_api/open_weather_map/OwmHttpRequestForOneCallAPI.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | import android.content.Context;
import org.secuso.privacyfriendlyweather.http.HttpRequestType;
import org.secuso.privacyfriendlyweather.http.IHttpRequest;
import org.secuso.privacyfriendlyweather.http.VolleyHttpRequest;
import org.secuso.privacyfriendlyweather.weather_api.IHttpRequestForOneCallAPI; | package org.secuso.privacyfriendlyweather.weather_api.open_weather_map;
/**
* This class provides the functionality for making and processing HTTP requests to the
* OpenWeatherMap to retrieve the latest weather data for all stored cities.
*/
public class OwmHttpRequestForOneCallAPI extends OwmHttpRequest implemen... | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/HttpRequestType.java
// public enum HttpRequestType {
// POST,
// GET,
// PUT,
// DELETE
// }
//
// Path: app/src/main/java/org/secuso/privacyfriendlyweather/http/IHttpRequest.java
// public interface IHttpRequest {
//
// /**
// ... | httpRequest.make(URL, HttpRequestType.GET, new ProcessOwmForecastOneCallAPIRequest(context)); |
SecUSo/privacy-friendly-weather | app/src/main/java/org/secuso/privacyfriendlyweather/database/dao/CityDao.java | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/City.java
// @Entity(tableName = "CITIES", indices = {@Index(value = {"city_name", "cities_id"})})
// public class City {
//
// private static final String UNKNOWN_POSTAL_CODE_VALUE = "-";
//
// @PrimaryKey @ColumnInfo(name = "cities_i... | import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import org.secuso.privacyfriendlyweather.database.data.City;
import java.util.List; | package org.secuso.privacyfriendlyweather.database.dao;
/**
* @author Christopher Beckmann
*/
@Dao
public interface CityDao {
@Insert | // Path: app/src/main/java/org/secuso/privacyfriendlyweather/database/data/City.java
// @Entity(tableName = "CITIES", indices = {@Index(value = {"city_name", "cities_id"})})
// public class City {
//
// private static final String UNKNOWN_POSTAL_CODE_VALUE = "-";
//
// @PrimaryKey @ColumnInfo(name = "cities_i... | void insertAll(List<City> cities); |
Psiphon-Labs/ploggy | AndroidApp/src/fi/iki/elonen/NanoHTTPD.java | // Path: AndroidApp/src/ca/psiphon/ploggy/Log.java
// public class Log {
//
// private static final String LOG_TAG = "Log";
//
// public static class Entry {
// public final Date mTimestamp;
// public final String mTag;
// public final String mMessage;
//
// public Entry(Strin... | import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.Closeable;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintW... |
myThread = new Thread(new Runnable() {
@Override
public void run() {
do {
try {
final Socket finalAccept = myServerSocket.accept();
registerConnection(finalAccept);
finalAccept.se... | // Path: AndroidApp/src/ca/psiphon/ploggy/Log.java
// public class Log {
//
// private static final String LOG_TAG = "Log";
//
// public static class Entry {
// public final Date mTimestamp;
// public final String mTag;
// public final String mMessage;
//
// public Entry(Strin... | Log.addEntry(LOG_TAG, e.getMessage()); |
Psiphon-Labs/ploggy | AndroidApp/src/ca/psiphon/ploggy/Downloads.java | // Path: AndroidApp/src/ca/psiphon/ploggy/Utils.java
// public static class ApplicationError extends Exception {
// private static final long serialVersionUID = -3656367025650685613L;
//
// public ApplicationError(String tag, String message) {
// if (tag != null) {
// Log.addEntry(tag, mess... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import android.content.Context;
import ca.psiphon.ploggy.Utils.ApplicationError; | /*
* Copyright (c) 2013, Psiphon Inc.
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*... | // Path: AndroidApp/src/ca/psiphon/ploggy/Utils.java
// public static class ApplicationError extends Exception {
// private static final long serialVersionUID = -3656367025650685613L;
//
// public ApplicationError(String tag, String message) {
// if (tag != null) {
// Log.addEntry(tag, mess... | public static OutputStream openDownloadResourceForAppending(Data.Download download) throws ApplicationError { |
Psiphon-Labs/ploggy | AndroidApp/src/ca/psiphon/ploggy/ActivitySettings.java | // Path: AndroidApp/src/ca/psiphon/ploggy/widgets/TimePickerPreference.java
// public class TimePickerPreference extends DialogPreference implements
// TimePicker.OnTimeChangedListener {
//
// /**
// * The validation expression for this preference
// */
// private stat... | import java.util.Map;
import android.content.SharedPreferences;
import android.content.SharedPreferences.OnSharedPreferenceChangeListener;
import android.os.Bundle;
import android.preference.Preference;
import android.preference.PreferenceFragment;
import ca.psiphon.ploggy.widgets.TimePickerPreference; |
initTimePickerPreferences();
}
@Override
public void onResume() {
super.onResume();
getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
}
@Override
public void onPause() {
super.on... | // Path: AndroidApp/src/ca/psiphon/ploggy/widgets/TimePickerPreference.java
// public class TimePickerPreference extends DialogPreference implements
// TimePicker.OnTimeChangedListener {
//
// /**
// * The validation expression for this preference
// */
// private stat... | if (preference instanceof TimePickerPreference) { |
Psiphon-Labs/ploggy | AndroidApp/src/ca/psiphon/ploggy/LocationMonitor.java | // Path: AndroidApp/src/ca/psiphon/ploggy/Utils.java
// public static class ApplicationError extends Exception {
// private static final long serialVersionUID = -3656367025650685613L;
//
// public ApplicationError(String tag, String message) {
// if (tag != null) {
// Log.addEntry(tag, mess... | import android.content.Context;
import android.location.Address;
import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.Handler;
import ca.psiphon.ploggy.Utils.ApplicationError; | /*
* Copyright (c) 2013, Psiphon Inc.
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*... | // Path: AndroidApp/src/ca/psiphon/ploggy/Utils.java
// public static class ApplicationError extends Exception {
// private static final long serialVersionUID = -3656367025650685613L;
//
// public ApplicationError(String tag, String message) {
// if (tag != null) {
// Log.addEntry(tag, mess... | public void start() throws Utils.ApplicationError { |
Psiphon-Labs/ploggy | AndroidApp/src/ca/psiphon/ploggy/Engine.java | // Path: AndroidApp/src/ca/psiphon/ploggy/widgets/TimePickerPreference.java
// public class TimePickerPreference extends DialogPreference implements
// TimePicker.OnTimeChangedListener {
//
// /**
// * The validation expression for this preference
// */
// private stat... | import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.EnumMap;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.ExecutorSe... |
public synchronized boolean getBooleanPreference(int keyResID) throws Utils.ApplicationError {
String key = mContext.getString(keyResID);
// Defaults which are "false" are not present in the preferences file
// if (!mSharedPreferences.contains(key)) {...}
// TODO: this is ambiguous:... | // Path: AndroidApp/src/ca/psiphon/ploggy/widgets/TimePickerPreference.java
// public class TimePickerPreference extends DialogPreference implements
// TimePicker.OnTimeChangedListener {
//
// /**
// * The validation expression for this preference
// */
// private stat... | int notBeforeHour = TimePickerPreference.getHour(sharingTimeNotBefore); |
Psiphon-Labs/ploggy | AndroidApp/src/ca/psiphon/ploggy/Utils.java | // Path: AndroidApp/src/de/schildbach/wallet/util/LinuxSecureRandom.java
// public class LinuxSecureRandom extends SecureRandomSpi
// {
// private static final long serialVersionUID = -6575880163829115605L;
// private static final FileInputStream urandom;
//
// private static class LinuxSecureRandomProvide... | import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.security.SecureRandom;
import java.text.DateFormat;
import java.... | // writes to that file, then renames to <target>. There's no CLOSE_WRITE event for <target>.
super(
directory.getAbsolutePath(),
FileObserver.MOVED_TO | FileObserver.CLOSE_WRITE);
mTargetFilenames = new ArrayList<String>(Arrays.asList(filenames));
... | // Path: AndroidApp/src/de/schildbach/wallet/util/LinuxSecureRandom.java
// public class LinuxSecureRandom extends SecureRandomSpi
// {
// private static final long serialVersionUID = -6575880163829115605L;
// private static final FileInputStream urandom;
//
// private static class LinuxSecureRandomProvide... | new LinuxSecureRandom(); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/index/JresRefresh.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.common.JresShardsReply;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpPost; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + "_refresh"; |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresRetrieveAliasesTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;
import java.util.Arrays; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | jres.quest(new JresCreateIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresRetrieveAliasesTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;
import java.util.Arrays; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresRetrieveAliasesReply response = jres.quest(new JresRetrieveAliases(index, "*")); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/query/JresMatchAllQuery.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Collections;
import java.util.Map; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.toJson(this); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/common/JresShardsReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | private Shards shards; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/index/JresIndexExists.java | // Path: jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicates.java
// public class JresPredicates {
//
// public static final Predicate<HttpResponse> STATUS_200 = new Predicate<HttpResponse>() {
// @Override
// public boolean apply(HttpResponse input) {
// return input.get... | import com.blacklocus.jres.handler.JresPredicates;
import com.blacklocus.jres.request.JresBooleanRequest;
import com.google.common.base.Predicate;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpHead; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicates.java
// public class JresPredicates {
//
// public static final Predicate<HttpResponse> STATUS_200 = new Predicate<HttpResponse>() {
// @Override
// public boolean apply(HttpResponse input) {
// return input.get... | return JresPredicates.STATUS_200; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/mapping/JresGetMapping.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.JresJsonReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpGet; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + JresPaths.slashedPath(type) + "_mapping"; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/search/JresSearchReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.model.search.Facets;
import com.blacklocus.jres.model.search.Hit;
import com.blacklocus.jres.model.search.Hits;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.t... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | private Shards shards; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/search/JresSearchReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.model.search.Facets;
import com.blacklocus.jres.model.search.Hit;
import com.blacklocus.jres.model.search.Hits;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.t... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | private Hits hits; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/search/JresSearchReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.model.search.Facets;
import com.blacklocus.jres.model.search.Hit;
import com.blacklocus.jres.model.search.Hits;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.t... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | private Facets facets; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/search/JresSearchReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | import com.blacklocus.jres.model.Shards;
import com.blacklocus.jres.model.search.Facets;
import com.blacklocus.jres.model.search.Hit;
import com.blacklocus.jres.model.search.Hits;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.t... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Shards.java
// public class Shards {
//
// private Integer total;
//
// private Integer successful;
//
// private Integer failed;
//
// public Integer getTotal() {
// return total;
// }
//
// public Integer getSuccessful() {... | return Lists.transform(getHits().getHits(), new Function<Hit, T>() { |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/document/JresGetDocumentReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java
// public class JresJsonReply implements JresReply {
//
// private JsonNode node;
//
// @Override
// public JsonNode node() {
// return node;
// }
//
// public JresJsonReply node(JsonNode node) {
// t... | import com.blacklocus.jres.response.JresJsonReply;
import com.blacklocus.jres.strings.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode; | private Boolean found;
@JsonProperty("_source")
private JsonNode source;
public String getIndex() {
return index;
}
public String getType() {
return type;
}
public String getId() {
return id;
}
public Integer getVersion() {
return version;
... | // Path: jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java
// public class JresJsonReply implements JresReply {
//
// private JsonNode node;
//
// @Override
// public JsonNode node() {
// return node;
// }
//
// public JresJsonReply node(JsonNode node) {
// t... | return ObjectMappers.fromJson(source, klass); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/query/JresMatchQuery.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import java.util.HashMap; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.toJson(this); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/alias/JresDeleteAlias.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpDelete; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + "_alias/" + alias; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/sort/JresFieldSort.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.toJson(this); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/model/search/Hit.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.JsonNode;
import com.google.common.base.MoreObjects; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return source == null ? null : ObjectMappers.fromJson(source, klass); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresDeleteAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.As... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | jres.quest(new JresCreateIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresDeleteAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.As... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresRetrieveAliasesReply retrieveAliasesResponse = jres.quest(new JresRetrieveAliases(index, alias)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresDeleteAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.As... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresAcknowledgedReply response = jres.quest(new JresDeleteAlias(index, alias)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresDeleteAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.As... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | @Test(expected = JresErrorReplyException.class) |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicatedResponseHandler.java | // Path: jres-core/src/main/java/com/blacklocus/jres/response/JresBooleanReply.java
// public class JresBooleanReply implements JresReply {
//
// private final boolean verity;
//
// public JresBooleanReply(boolean verity) {
// this.verity = verity;
// }
//
// @Override
// public JsonNode ... | import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.google.common.base.Predicate;
import org.apache.http.HttpResponse;
import java.io.IOException; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/response/JresBooleanReply.java
// public class JresBooleanReply implements JresReply {
//
// private final boolean verity;
//
// public JresBooleanReply(boolean verity) {
// this.verity = verity;
// }
//
// @Override
// public JsonNode ... | public JresBooleanReply handleResponse(HttpResponse http) throws IOException, JresErrorReplyException { |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/mapping/JresPutMapping.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpPut; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + JresPaths.slashedPath(type) + "_mapping"; |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresRefreshTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.common.JresShardsReply;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresShardsReply refreshReply = jres.quest(new JresRefresh(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresTypeExistsTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | jres.quest(new JresCreateIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresTypeExistsTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresBooleanReply response = jres.bool(new JresTypeExists(index, type)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresGetMappingTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | jres.quest(new JresCreateIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresFlushTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.common.JresShardsReply;
import com.google.common.collect.ImmutableMap;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresShardsReply flushReply = jres.quest(new JresFlush(index)); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/index/JresGetIndexSettings.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.JresJsonReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpGet; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + "_settings"; |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresIndexExistsTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.JresBooleanReply;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresBooleanReply res = jres.bool(new JresIndexExists(index)); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/common/JresIndicesReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Indices.java
// public class Indices extends HashMap<String, Shards> {
//
//
// }
//
// Path: jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java
// public class JresJsonReply implements JresReply {
//
// private JsonNode node;
//
/... | import com.blacklocus.jres.model.Indices;
import com.blacklocus.jres.response.JresJsonReply;
import com.fasterxml.jackson.annotation.JsonProperty; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/model/Indices.java
// public class Indices extends HashMap<String, Shards> {
//
//
// }
//
// Path: jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java
// public class JresJsonReply implements JresReply {
//
// private JsonNode node;
//
/... | private Indices indices; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/alias/JresAddAlias.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpPut; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + "_alias/" + alias; |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresDeleteIndexTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresAcknowledgedReply deleteReply = jres.quest(new JresDeleteIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresDeleteIndexTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | @Test(expected = JresErrorReplyException.class) |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/query/JresRangeQuery.java | // Path: jres-core/src/main/java/com/blacklocus/misc/NoNullsMap.java
// public class NoNullsMap<K, V> extends HashMap<K, V> {
//
// public static <K, V> ImmutableMap<K, V> of(K k1, V v1) {
// NoNullsMap<K, V> map = new NoNullsMap<K, V>(1);
// map.put(k1, v1);
// return ImmutableMap.copyOf(m... | import com.blacklocus.misc.NoNullsMap;
import com.fasterxml.jackson.annotation.JsonValue;
import com.google.common.collect.ImmutableMap; | }
public JresRangeQuery gte(Object value) {
this.gte = value;
return this;
}
public JresRangeQuery gt(Object value) {
this.gt = value;
return this;
}
public JresRangeQuery lte(Object value) {
this.lte = value;
return this;
}
public Jres... | // Path: jres-core/src/main/java/com/blacklocus/misc/NoNullsMap.java
// public class NoNullsMap<K, V> extends HashMap<K, V> {
//
// public static <K, V> ImmutableMap<K, V> of(K k1, V v1) {
// NoNullsMap<K, V> map = new NoNullsMap<K, V>(1);
// map.put(k1, v1);
// return ImmutableMap.copyOf(m... | field, NoNullsMap.of( |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/query/JresTermQuery.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import java.util.HashMap; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.toJson(this); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresGetIndexSettingsTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | @Test(expected = JresErrorReplyException.class) |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresAddAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;
import java.util.Arrays; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | jres.quest(new JresCreateIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresAddAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;
import java.util.Arrays; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresRetrieveAliasesReply retrieveAliasesReply = jres.quest(new JresRetrieveAliases(index, alias)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/alias/JresAddAliasTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test;
import java.util.Arrays; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | @Test(expected = JresErrorReplyException.class) |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/response/JresJsonReply.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import com.fasterxml.jackson.databind.JsonNode;
import java.io.IOException; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.PRETTY.writeValueAsString(node()); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/document/JresGetDocument.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.document.JresGetDocumentReply;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpGet; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index, type) + id; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/alias/JresRetrieveAliases.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.alias.JresRetrieveAliasesReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpGet; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(indexPattern) + "_alias/" + aliasPattern; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/index/JresFlush.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.common.JresShardsReply;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpPost; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + "_flush"; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/query/JresQueryStringQuery.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import com.fasterxml.jackson.annotation.JsonProperty; |
public void setDefaultField(String defaultField) {
this.defaultField = defaultField;
}
public JresQueryStringQuery withDefaultField(String defaultField) {
this.defaultField = defaultField;
return this;
}
public String getDefaultOperator() {
return defaultOperator;
... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.toJson(this); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresPutMappingTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import o... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | } catch (JresErrorReplyException e) { |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresPutMappingTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import o... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | jres.quest(new JresCreateIndex(index)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresPutMappingTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import o... | jres.quest(new JresCreateIndex(index));
try {
jres.quest(new JresPutMapping(index, type, null));
Assert.fail("Invalid data");
} catch (JresErrorReplyException e) {
// good
}
try {
jres.quest(new JresPutMapping(index, type, ""));
... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresBooleanReply response = jres.bool(new JresTypeExists(index, type)); |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/mapping/JresPutMappingTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.request.index.JresCreateIndex;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresAcknowledgedReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import o... | // good
}
try {
jres.quest(new JresPutMapping(index, type, ""));
Assert.fail("Invalid data");
} catch (JresErrorReplyException e) {
// good
}
try {
jres.quest(new JresPutMapping(index, type, "{}"));
Assert.... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresAcknowledgedReply response = jres.quest(new JresPutMapping(index, type, "{\"test\":{}}")); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/JresSearch.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.response.search.JresSearchReply;
import com.blacklocus.jres.strings.JresPaths;
import org.apache.http.client.methods.HttpPost;
import javax.annotation.Nullable; | public JresSearch(JresSearchBody searchBody) {
this(null, null, searchBody);
}
public JresSearch(@Nullable String index) {
this(index, null, new JresSearchBody());
}
public JresSearch(@Nullable String index, @Nullable String type) {
this(index, type, new JresSearchBody());
... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + JresPaths.slashedPath(type) + "_search"; |
blacklocus/jres | jres-test/src/test/java/com/blacklocus/jres/request/index/JresCreateIndexTest.java | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | import com.blacklocus.jres.BaseJresTest;
import com.blacklocus.jres.response.JresBooleanReply;
import com.blacklocus.jres.response.common.JresErrorReplyException;
import org.junit.Assert;
import org.junit.Test; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-test/src/main/java/com/blacklocus/jres/BaseJresTest.java
// public class BaseJresTest {
//
// @BeforeClass
// public static void startLocalElasticSearch() {
// ElasticSearchTestInstance.triggerStaticInit();
// }
//
// /**
// * Configured to connect to a local ElasticSearch i... | JresBooleanReply indexExistsResponse = jres.bool(new JresIndexExists(indexName)); |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/mapping/JresTypeExists.java | // Path: jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicates.java
// public class JresPredicates {
//
// public static final Predicate<HttpResponse> STATUS_200 = new Predicate<HttpResponse>() {
// @Override
// public boolean apply(HttpResponse input) {
// return input.get... | import com.blacklocus.jres.handler.JresPredicates;
import com.blacklocus.jres.request.JresBooleanRequest;
import com.blacklocus.jres.strings.JresPaths;
import com.google.common.base.Predicate;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpHead; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicates.java
// public class JresPredicates {
//
// public static final Predicate<HttpResponse> STATUS_200 = new Predicate<HttpResponse>() {
// @Override
// public boolean apply(HttpResponse input) {
// return input.get... | return JresPaths.slashedPath(index) + type; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/mapping/JresTypeExists.java | // Path: jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicates.java
// public class JresPredicates {
//
// public static final Predicate<HttpResponse> STATUS_200 = new Predicate<HttpResponse>() {
// @Override
// public boolean apply(HttpResponse input) {
// return input.get... | import com.blacklocus.jres.handler.JresPredicates;
import com.blacklocus.jres.request.JresBooleanRequest;
import com.blacklocus.jres.strings.JresPaths;
import com.google.common.base.Predicate;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpHead; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/handler/JresPredicates.java
// public class JresPredicates {
//
// public static final Predicate<HttpResponse> STATUS_200 = new Predicate<HttpResponse>() {
// @Override
// public boolean apply(HttpResponse input) {
// return input.get... | return JresPredicates.STATUS_200; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/JresDeleteByQuery.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.request.search.query.JresQuery;
import com.blacklocus.jres.response.common.JresIndicesReply;
import com.blacklocus.jres.strings.JresPaths;
import com.google.common.collect.ImmutableMap;
import org.apache.http.client.methods.HttpDelete;
impor... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | private final Map<String, JresQuery> query; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/request/search/JresDeleteByQuery.java | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | import com.blacklocus.jres.request.JresJsonRequest;
import com.blacklocus.jres.request.search.query.JresQuery;
import com.blacklocus.jres.response.common.JresIndicesReply;
import com.blacklocus.jres.strings.JresPaths;
import com.google.common.collect.ImmutableMap;
import org.apache.http.client.methods.HttpDelete;
impor... | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/request/JresJsonRequest.java
// public abstract class JresJsonRequest<REPLY extends JresReply> implements JresRequest<REPLY> {
//
// private final Class<REPLY> responseClass;
//
// protected JresJsonRequest(Class<REPLY> responseClass) {
// this.resp... | return JresPaths.slashedPath(index) + JresPaths.slashedPath(type) + "_query"; |
blacklocus/jres | jres-core/src/main/java/com/blacklocus/jres/model/search/Facets.java | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | import com.blacklocus.jres.strings.ObjectMappers;
import com.fasterxml.jackson.databind.JsonNode;
import java.util.HashMap; | /**
* Copyright 2015 BlackLocus
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | // Path: jres-core/src/main/java/com/blacklocus/jres/strings/ObjectMappers.java
// public class ObjectMappers {
//
// public static final ObjectMapper NORMAL = newConfiguredObjectMapper();
//
// public static final ObjectMapper PRETTY = newConfiguredObjectMapper();
// static {
// PRETTY.configure(... | return ObjectMappers.fromJson(get(facetName), klass); |
rvillars/edoras-one-initializr | src/main/java/com/edorasware/one/initializr/web/support/EdorasoneMetadataReader.java | // Path: src/main/java/com/edorasware/one/initializr/metadata/DefaultMetadataElement.java
// public class DefaultMetadataElement extends MetadataElement {
//
// private boolean defaultValue;
//
// public DefaultMetadataElement() {
// }
//
// public DefaultMetadataElement(String id, String name, boolean defaultVa... | import com.edorasware.one.initializr.metadata.DefaultMetadataElement;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List; | /*
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | // Path: src/main/java/com/edorasware/one/initializr/metadata/DefaultMetadataElement.java
// public class DefaultMetadataElement extends MetadataElement {
//
// private boolean defaultValue;
//
// public DefaultMetadataElement() {
// }
//
// public DefaultMetadataElement(String id, String name, boolean defaultVa... | public List<DefaultMetadataElement> getEdorasoneVersions() { |
rvillars/edoras-one-initializr | src/main/java/com/edorasware/one/initializr/web/support/OfflineInitializrMetadataBuilder.java | // Path: src/main/java/com/edorasware/one/initializr/metadata/InitializrConfiguration.java
// public static class ParentPom {
//
// /**
// * Parent pom groupId.
// */
// private String groupId;
//
// /**
// * Parent pom artifactId.
// */
// private String artifactId;
//
// /**
// * Parent pom version.... | import com.edorasware.one.initializr.metadata.*;
import com.edorasware.one.initializr.metadata.InitializrConfiguration.Env.Maven.ParentPom;
import org.springframework.util.StringUtils;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays; | ;
}
public OfflineInitializrMetadataBuilder addBom(String id, String groupId,
String artifactId, String version) {
BillOfMaterials bom = BillOfMaterials.create(groupId, artifactId, version);
return addBom(id, bom);
}
pu... | // Path: src/main/java/com/edorasware/one/initializr/metadata/InitializrConfiguration.java
// public static class ParentPom {
//
// /**
// * Parent pom groupId.
// */
// private String groupId;
//
// /**
// * Parent pom artifactId.
// */
// private String artifactId;
//
// /**
// * Parent pom version.... | ParentPom parent = it.getConfiguration().getEnv().getMaven().getParent(); |
rvillars/edoras-one-initializr | src/main/java/com/edorasware/one/initializr/generator/BuildProperties.java | // Path: src/main/java/com/edorasware/one/initializr/util/VersionProperty.java
// public class VersionProperty implements Serializable, Comparable<VersionProperty> {
//
// private static final List<Character> SUPPORTED_CHARS = Arrays.asList('.', '-');
//
// private final String property;
//
// public VersionPrope... | import com.edorasware.one.initializr.util.VersionProperty;
import java.util.Map;
import java.util.TreeMap;
import java.util.function.Supplier; | /*
* Copyright 2012-2016 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | // Path: src/main/java/com/edorasware/one/initializr/util/VersionProperty.java
// public class VersionProperty implements Serializable, Comparable<VersionProperty> {
//
// private static final List<Character> SUPPORTED_CHARS = Arrays.asList('.', '-');
//
// private final String property;
//
// public VersionPrope... | private final TreeMap<VersionProperty, Supplier<String>> versions = new TreeMap<>(); |
rvillars/edoras-one-initializr | src/main/java/com/edorasware/one/initializr/util/VersionParser.java | // Path: src/main/java/com/edorasware/one/initializr/util/Version.java
// public static class Qualifier implements Serializable {
//
// public Qualifier(String qualifier) {
// this.qualifier = qualifier;
// }
//
// private String qualifier;
// private Integer version;
//
// public String getQualifier() {
// ... | import com.edorasware.one.initializr.util.Version.Qualifier;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import java.util.Collections;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors; | /*
* Copyright 2012-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by ap... | // Path: src/main/java/com/edorasware/one/initializr/util/Version.java
// public static class Qualifier implements Serializable {
//
// public Qualifier(String qualifier) {
// this.qualifier = qualifier;
// }
//
// private String qualifier;
// private Integer version;
//
// public String getQualifier() {
// ... | Qualifier qualifier = null; |
rvillars/edoras-one-initializr | src/test/java/com/edorasware/one/initializr/test/metadata/InitializrMetadataTestBuilder.java | // Path: src/main/java/com/edorasware/one/initializr/metadata/InitializrConfiguration.java
// public static class ParentPom {
//
// /**
// * Parent pom groupId.
// */
// private String groupId;
//
// /**
// * Parent pom artifactId.
// */
// private String artifactId;
//
// /**
// * Parent pom version.... | import com.edorasware.one.initializr.metadata.*;
import com.edorasware.one.initializr.metadata.InitializrConfiguration.Env.Maven.ParentPom;
import org.springframework.util.StringUtils;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Arrays; | return this;
}
public InitializrMetadataTestBuilder addBom(String id, String groupId,
String artifactId, String version) {
BillOfMaterials bom = BillOfMaterials.create(groupId, artifactId, version);
return addBom(id, bom);
}
public InitializrMetadataTestBuilder addBom(String id, BillOfMaterials bom) {
... | // Path: src/main/java/com/edorasware/one/initializr/metadata/InitializrConfiguration.java
// public static class ParentPom {
//
// /**
// * Parent pom groupId.
// */
// private String groupId;
//
// /**
// * Parent pom artifactId.
// */
// private String artifactId;
//
// /**
// * Parent pom version.... | ParentPom parent = it.getConfiguration().getEnv().getMaven().getParent(); |
rvillars/edoras-one-initializr | src/main/java/com/edorasware/one/initializr/generator/ProjectGenerator.java | // Path: src/main/java/com/edorasware/one/initializr/InitializrException.java
// @SuppressWarnings("serial")
// public class InitializrException extends RuntimeException {
//
// public InitializrException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public InitializrException(String me... | import com.edorasware.one.initializr.InitializrException;
import com.edorasware.one.initializr.metadata.*;
import com.edorasware.one.initializr.metadata.InitializrConfiguration.Env.Maven.ParentPom;
import com.edorasware.one.initializr.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springfra... | public void setProjectResourceLocator(ProjectResourceLocator projectResourceLocator) {
this.projectResourceLocator = projectResourceLocator;
}
public void setTmpdir(String tmpdir) {
this.tmpdir = tmpdir;
}
public void setTemporaryDirectory(File temporaryDirectory) {
this.temporaryDirectory = temporaryDirec... | // Path: src/main/java/com/edorasware/one/initializr/InitializrException.java
// @SuppressWarnings("serial")
// public class InitializrException extends RuntimeException {
//
// public InitializrException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public InitializrException(String me... | catch (InitializrException ex) { |
rvillars/edoras-one-initializr | src/main/java/com/edorasware/one/initializr/generator/ProjectGenerator.java | // Path: src/main/java/com/edorasware/one/initializr/InitializrException.java
// @SuppressWarnings("serial")
// public class InitializrException extends RuntimeException {
//
// public InitializrException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public InitializrException(String me... | import com.edorasware.one.initializr.InitializrException;
import com.edorasware.one.initializr.metadata.*;
import com.edorasware.one.initializr.metadata.InitializrConfiguration.Env.Maven.ParentPom;
import com.edorasware.one.initializr.util.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springfra... | write(new File(dir, ".gitignore"), "gitignore.tmpl", model);
}
/**
* Resolve the specified {@link ProjectRequest} and return the model to use to
* generate the project
* @param originalRequest the request to handle
* @return a model for that request
*/
protected Map<String, Object> resolveModel(ProjectR... | // Path: src/main/java/com/edorasware/one/initializr/InitializrException.java
// @SuppressWarnings("serial")
// public class InitializrException extends RuntimeException {
//
// public InitializrException(String message, Throwable cause) {
// super(message, cause);
// }
//
// public InitializrException(String me... | ParentPom parentPom = null; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.