code
stringlengths
73
34.1k
label
stringclasses
1 value
public List<M> findNear(double latitude, double longitude, int numImages) { return getDatastore().find(clazz).field("location.coordinates").near(latitude, longitude).limit(numImages).asList(); }
java
public List<M> search(String datefield, Date date, int width, int height, int count, int offset, UserAccount account, String query, List<String> sources) { List<Criteria> l = new ArrayList<>(); Query<M> q = getDatastore().createQuery(clazz); if (query != null) { Pattern p = Pattern....
java
@SuppressWarnings("deprecation") public static void setBackground(@NonNull final View view, @Nullable final Drawable background) { Condition.INSTANCE.ensureNotNull(view, "The view may not be null"); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { ...
java
@SuppressWarnings("deprecation") public static void removeOnGlobalLayoutListener(@NonNull final ViewTreeObserver observer, @Nullable final OnGlobalLayoutListener listener) { Condition.INSTANCE.ensureNotNull(observer, "The view tree observer may not be null...
java
public static void removeFromParent(@NonNull final View view) { Condition.INSTANCE.ensureNotNull(view, "The view may not be null"); ViewParent parent = view.getParent(); if (parent instanceof ViewGroup) { ((ViewGroup) parent).removeView(view); } }
java
private void obtainScaledEdge(@NonNull final TypedArray typedArray) { int defaultValue = Edge.VERTICAL.getValue(); Edge scaledEdge = Edge.fromValue( typedArray.getInt(R.styleable.SquareImageView_scaledEdge, defaultValue)); setScaledEdge(scaledEdge); }
java
private static boolean _isValidForCycle (@Nonnull final Holiday aHoliday, final int nYear) { final String sEvery = aHoliday.getEvery (); if (sEvery != null && !"EVERY_YEAR".equals (sEvery)) { if ("ODD_YEARS".equals (sEvery)) return nYear % 2 != 0; if ("EVEN_YEARS".equals (sEvery)) ...
java
private static boolean _isValidInYear (@Nonnull final Holiday aHoliday, final int nYear) { return (aHoliday.getValidFrom () == null || aHoliday.getValidFrom ().intValue () <= nYear) && (aHoliday.getValidTo () == null || aHoliday.getValidTo ().intValue () >= nYear); }
java
protected static final boolean shallBeMoved (@Nonnull final LocalDate aFixed, @Nonnull final MovingCondition aMoveCond) { return aFixed.getDayOfWeek () == XMLHolidayHelper.getWeekday (aMoveCond.getSubstitute ()); }
java
private static LocalDate _moveDate (final MovingCondition aMoveCond, final LocalDate aDate) { final DayOfWeek nWeekday = XMLHolidayHelper.getWeekday (aMoveCond.getWeekday ()); final int nDirection = aMoveCond.getWith () == With.NEXT ? 1 : -1; LocalDate aMovedDate = aDate; while (aMovedDate.getDayOfWe...
java
protected static final LocalDate moveDate (final MoveableHoliday aMoveableHoliday, final LocalDate aFixed) { for (final MovingCondition aMoveCond : aMoveableHoliday.getMovingCondition ()) if (shallBeMoved (aFixed, aMoveCond)) return _moveDate (aMoveCond, aFixed); return aFixed; }
java
protected final void setCurrentParentView(@NonNull final View currentParentView) { Condition.INSTANCE.ensureNotNull(currentParentView, "The parent view may not be null"); this.currentParentView = currentParentView; }
java
@SuppressWarnings("unchecked") protected final <ViewType extends View> ViewType findViewById(@IdRes final int viewId) { Condition.INSTANCE.ensureNotNull(currentParentView, "No parent view set", IllegalStateException.class); ViewHolder viewHolder = (ViewHolder) currentParentView.getTa...
java
private void writeSlot(T data, Throwable error) { dataLock.lock(); try { this.error = error; this.data = data; availableCondition.signalAll(); } finally { dataLock.unlock(); } }
java
private T getAndClearUnderLock() throws Throwable { if(error != null) { throw error; } else { // Return and clear current T retValue = data; data = null; return retValue; } }
java
public T take() throws Throwable { dataLock.lock(); try { while(data == null && error == null) { try { availableCondition.await(); } catch(InterruptedException e) { // ignore and re-loop in case of spurious wake-ups } } // should only ge...
java
public Object yyparse (yyInput yyLex, Object yydebug) throws java.io.IOException { //t this.yydebug = (jay.yydebug.yyDebug)yydebug; return yyparse(yyLex); }
java
private HttpClient createPooledClient() { HttpParams connMgrParams = new BasicHttpParams(); SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme(HTTP_SCHEME, PlainSocketFactory.getSocketFactory(), HTTP_PORT)); schemeRegistry.register(new Scheme(HTTPS_SCHEME, SSLS...
java
public void addTransition(DuzztAction action, DuzztState succ) { transitions.put(action, new DuzztTransition(action, succ)); }
java
public static ObjectNode getObj(ObjectNode obj, String fieldName) { return obj != null ? obj(obj.get(fieldName)) : null; }
java
public static ObjectNode getObjAndRemove(ObjectNode obj, String fieldName) { ObjectNode result = null; if (obj != null) { result = obj(remove(obj, fieldName)); } return result; }
java
public static ArrayNode createArray(boolean fallbackToEmptyArray, JsonNode... nodes) { ArrayNode array = null; for (JsonNode element: nodes) { if (element != null) { if (array == null) { array = new ArrayNode(JsonNodeFactory.instance); } array.add(element); } } if ((array == null) && fall...
java
public static ArrayNode getArray(ObjectNode obj, String fieldName) { return obj == null ? null : array(obj.get(fieldName)); }
java
public static ArrayNode getArrayAndRemove(ObjectNode obj, String fieldName) { ArrayNode result = null; if (obj != null) { result = array(remove(obj, fieldName)); } return result; }
java
public static JsonNode remove(ObjectNode obj, String fieldName) { JsonNode result = null; if (obj != null) { result = obj.remove(fieldName); } return result; }
java
public static void rename(ObjectNode obj, String oldFieldName, String newFieldName) { if (obj != null && isNotBlank(oldFieldName) && isNotBlank(newFieldName)) { JsonNode node = remove(obj, oldFieldName); if (node != null) { obj.set(newFieldName, node); } } }
java
private static final String stripParams(String mediaType) { int sc = mediaType.indexOf(';'); if (sc >= 0) mediaType = mediaType.substring(0, sc); return mediaType; }
java
public static String getDefaultMediaType(ResultType expectedType) { ResponseFormat format = (expectedType != null) ? defaultTypeFormats.get(expectedType) : null; // If the expected type is unknown, we should let the server decide, otherwise we could // wind up requesting a response type that doesn't ma...
java
private static final ResultParser findParser(String mediaType, ResultType expectedType) { ResponseFormat format = null; // Prefer MIME type when choosing result format. if (mediaType != null) { mediaType = stripParams(mediaType); format = mimeFormats.get(mediaType); if (format == null...
java
public static Filter equalsFilter(String column, Object operand) { return new Filter(column, FilterOperator.EQUALS, operand); }
java
public static Filter inFilter(String column, Object operand) { return new Filter(column, FilterOperator.IN, operand); }
java
@NonNull protected final View inflatePlaceholderView(@Nullable final View convertView, final int height) { View view = convertView; if (!(view instanceof PlaceholderView)) { view = new PlaceholderView(getContext()); } view...
java
protected final int getViewHeight(@NonNull final ListAdapter adapter, final int position) { View view = adapter.getView(position, null, this); LayoutParams layoutParams = (LayoutParams) view.getLayoutParams(); if (layoutParams == null) { layoutParams = new LayoutParams(LayoutParams....
java
private OnItemClickListener createItemClickListener( @NonNull final OnItemClickListener encapsulatedListener) { return new OnItemClickListener() { @Override public void onItemClick(final AdapterView<?> parent, final View view, final int po...
java
private OnItemLongClickListener createItemLongClickListener( @NonNull final OnItemLongClickListener encapsulatedListener) { return new OnItemLongClickListener() { @Override public boolean onItemLongClick(final AdapterView<?> parent, final View view, ...
java
private int getItemPosition(final int position) { int numColumns = getNumColumnsCompatible(); int headerItemCount = getHeaderViewsCount() * numColumns; int adapterCount = adapter.getEncapsulatedAdapter().getCount(); if (position < headerItemCount) { return position / numColu...
java
private int getNumberOfPlaceholderViews() { int numColumns = getNumColumnsCompatible(); int adapterCount = adapter.getEncapsulatedAdapter().getCount(); int lastLineCount = adapterCount % numColumns; return lastLineCount > 0 ? numColumns - lastLineCount : 0; }
java
public final void addHeaderView(@NonNull final View view, @Nullable final Object data, final boolean selectable) { Condition.INSTANCE.ensureNotNull(view, "The view may not be null"); headers.add(new FullWidthItem(view, data, selectable)); notifyDataSetChanged(...
java
public final void addFooterView(@NonNull final View view, @Nullable final Object data, final boolean selectable) { Condition.INSTANCE.ensureNotNull(view, "The view may not be null"); footers.add(new FullWidthItem(view, data, selectable)); notifyDataSetChanged(...
java
private void asyncMoreRequest(int startRow) { try { DataRequest moreRequest = new DataRequest(); moreRequest.queryId = queryId; moreRequest.startRow = startRow; moreRequest.maxSize = maxBatchSize; logger.debug("Client requesting {} .. {}", startRow, (startRow + maxBatchSize - 1)); ...
java
private static final String encode(String s) { try { return URLEncoder.encode(s, UTF_8); } catch (UnsupportedEncodingException e) { throw new Error("JVM unable to handle UTF-8"); } }
java
@SuppressWarnings("unused") private static final void dump(HttpClient client, HttpUriRequest req) { if (logger.isTraceEnabled()) { StringBuilder sb = new StringBuilder("\n=== Request ==="); sb.append("\n").append(req.getRequestLine()); for (Header h : req.getAllHeaders()) { sb.append("\n...
java
static HttpResponse executeRequest(ProtocolCommand command, String mimeType) { HttpClient client = ((ProtocolConnection)command.getConnection()).getHttpClient(); URL url = ((ProtocolDataSource)command.getConnection().getDataSource()).getUrl(); HttpUriRequest req; try { String params = "query=" + ...
java
static void addHeaders(HttpUriRequest req, String mimeType) { if (POST.equalsIgnoreCase(req.getMethod())) { req.addHeader(CONTENT_TYPE, FORM_ENCODED); } if (mimeType != null) req.setHeader(ACCEPT, mimeType); }
java
@Override public HolidayMap getHolidays (final int nYear, @Nullable final String... aArgs) { final HolidayMap aHolidays = super.getHolidays (nYear, aArgs); final HolidayMap aAdditionalHolidays = new HolidayMap (); for (final Map.Entry <LocalDate, ISingleHoliday> aEntry : aHolidays.getMap ().entrySet ())...
java
public final void setLogLevel(@NonNull final LogLevel logLevel) { Condition.INSTANCE.ensureNotNull(logLevel, "The log level may not be null"); this.logLevel = logLevel; }
java
public final void logVerbose(@NonNull final Class<?> tag, @NonNull final String message) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condition.INSTANCE.ensureNotEmpty(message, "The message may not b...
java
public final void logDebug(@NonNull final Class<?> tag, @NonNull final String message) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condition.INSTANCE.ensureNotEmpty(message, "The message may not be ...
java
public final void logInfo(@NonNull final Class<?> tag, @NonNull final String message) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condition.INSTANCE.ensureNotEmpty(message, "The message may not be e...
java
public final void logWarn(@NonNull final Class<?> tag, @NonNull final String message, @NonNull final Throwable cause) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condit...
java
public final void logError(@NonNull final Class<?> tag, @NonNull final String message) { Condition.INSTANCE.ensureNotNull(tag, "The tag may not be null"); Condition.INSTANCE.ensureNotNull(message, "The message may not be null"); Condition.INSTANCE.ensureNotEmpty(message, "The message may not be ...
java
public static Orientation getOrientation(@NonNull final Context context) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); int orientation = context.getResources().getConfiguration().orientation; if (orientation == Configuration.ORIENTATION_UNDEFINED) { int...
java
public static DeviceType getDeviceType(@NonNull final Context context) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); return DeviceType.fromValue(context.getString(R.string.device_type)); }
java
public static int getDisplayWidth(@NonNull final Context context) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); return context.getResources().getDisplayMetrics().widthPixels; }
java
public static int getDisplayHeight(@NonNull final Context context) { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); return context.getResources().getDisplayMetrics().heightPixels; }
java
public static Driver createDriver(FeedPartition feedPartition, Plan plan, MetricRegistry metricRegistry){ populateFeedMetricInfo(plan, feedPartition, metricRegistry); OperatorDesc desc = plan.getRootOperator(); Operator oper = buildOperator(desc, metricRegistry, plan.getName(), feedPartition); OffsetSto...
java
private static NitDesc nitDescFromDynamic(DynamicInstantiatable d){ NitDesc nd = new NitDesc(); nd.setScript(d.getScript()); nd.setTheClass(d.getTheClass()); if (d.getSpec() == null || "java".equals(d.getSpec())){ nd.setSpec(NitDesc.NitSpec.JAVA_LOCAL_CLASSPATH); } else if ("groovy".equals(d.g...
java
public static Operator buildOperator(OperatorDesc operatorDesc, MetricRegistry metricRegistry, String planPath, FeedPartition feedPartition) { Operator operator = null; NitFactory nitFactory = new NitFactory(); NitDesc nitDesc = nitDescFromDynamic(operatorDesc); try { if (nitDesc.getSpec() == NitD...
java
public static Feed buildFeed(FeedDesc feedDesc){ Feed feed = null; NitFactory nitFactory = new NitFactory(); NitDesc nitDesc = nitDescFromDynamic(feedDesc); nitDesc.setConstructorParameters(new Class [] { Map.class }); nitDesc.setConstructorArguments(new Object[] { feedDesc.getProperties() }); t...
java
private static int getSampleSize(@NonNull final Pair<Integer, Integer> imageDimensions, final int maxWidth, final int maxHeight) { Condition.INSTANCE.ensureNotNull(imageDimensions, "The image dimensions may not be null"); Condition.INSTANCE.ensureAtLeast(maxWidth, 1,...
java
public static Bitmap clipCircle(@NonNull final Bitmap bitmap, final int size) { Bitmap squareBitmap = clipSquare(bitmap, size); int squareSize = squareBitmap.getWidth(); float radius = (float) squareSize / 2.0f; Bitmap clippedBitmap = Bitmap.createBitmap(squareSize, squareSize, Bitmap.Co...
java
public static Bitmap clipCircle(@NonNull final Bitmap bitmap, final int size, final int borderWidth, @ColorInt final int borderColor) { Condition.INSTANCE.ensureAtLeast(borderWidth, 0, "The border width must be at least 0"); Bitmap clippedBitmap = clipCircle(bitmap, s...
java
public static Bitmap clipSquare(@NonNull final Bitmap bitmap) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); return clipSquare(bitmap, bitmap.getWidth() >= bitmap.getHeight() ? bitmap.getHeight() : bitmap.getWidth()); }
java
@SuppressWarnings("SuspiciousNameCombination") public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int size) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Condition.INSTANCE.ensureAtLeast(size, 1, "The size must be at least 1"); Bitmap clippedBitma...
java
public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int borderWidth, @ColorInt final int borderColor) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); return clipSquare(bitmap, bitmap.getWidth() >= bitmap.getHei...
java
public static Bitmap clipSquare(@NonNull final Bitmap bitmap, final int size, final int borderWidth, @ColorInt final int borderColor) { Condition.INSTANCE.ensureAtLeast(borderWidth, 0, "The border width must be at least 0"); Bitmap clippedBitmap = clipSquare(bitmap, s...
java
public static Bitmap resize(@NonNull final Bitmap bitmap, final int width, final int height) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Condition.INSTANCE.ensureAtLeast(width, 1, "The width must be at least 1"); Condition.INSTANCE.ensureAtLeast(height, 1, "The heig...
java
public static Pair<Bitmap, Bitmap> splitHorizontally(@NonNull final Bitmap bitmap) { return splitHorizontally(bitmap, bitmap.getHeight() / 2); }
java
public static Pair<Bitmap, Bitmap> splitHorizontally(@NonNull final Bitmap bitmap, final int splitPoint) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Condition.INSTANCE.ensureGreater(splitPoint, 0, "The split point mus...
java
public static Pair<Bitmap, Bitmap> splitVertically(@NonNull final Bitmap bitmap) { return splitVertically(bitmap, bitmap.getWidth() / 2); }
java
public static Pair<Bitmap, Bitmap> splitVertically(@NonNull final Bitmap bitmap, final int splitPoint) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Condition.INSTANCE.ensureGreater(splitPoint, 0, "The split point must be...
java
public static Bitmap tile(final Bitmap bitmap, final int width, final int height) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Condition.INSTANCE.ensureAtLeast(width, 1, "The width must be at least 1"); Condition.INSTANCE.ensureAtLeast(height, 1, "The height must be ...
java
public static Bitmap tint(@NonNull final Bitmap bitmap, @ColorInt final int color) { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Canvas canvas = new Canvas(bitmap); Paint paint = new Paint(); paint.setColor(color); canvas.drawRect(new Rect(0, 0, bitmap...
java
public static Bitmap drawableToBitmap(@NonNull final Drawable drawable) { Condition.INSTANCE.ensureNotNull(drawable, "The drawable may not be null"); if (drawable instanceof BitmapDrawable) { BitmapDrawable bitmapDrawable = (BitmapDrawable) drawable; if (bitmapDrawable.getBitma...
java
public static Bitmap colorToBitmap(final int width, final int height, @ColorInt final int color) { Condition.INSTANCE.ensureAtLeast(width, 1, "The width must be at least 1"); Condition.INSTANCE.ensureAtLeast(height, 1, "The height must be at least 1"); Bitm...
java
public static Pair<Integer, Integer> getImageDimensions(@NonNull final File file) throws IOException { Condition.INSTANCE.ensureNotNull(file, "The file may not be null"); Condition.INSTANCE .ensureFileIsNoDirectory(file, "The file must exist and must not be a directory"); ...
java
public static Pair<Integer, Integer> getImageDimensions(@NonNull final Context context, @DrawableRes final int resourceId) throws IOException { Condition.INSTANCE.ensureNotNull(context, "The context may not be null"); BitmapFactory....
java
public static Bitmap loadThumbnail(@NonNull final File file, final int maxWidth, final int maxHeight) throws IOException { Pair<Integer, Integer> imageDimensions = getImageDimensions(file); int sampleSize = getSampleSize(imageDimensions, maxWidth, maxHeight); ...
java
public static void compressToFile(@NonNull final Bitmap bitmap, @NonNull final File file, @NonNull final CompressFormat format, final int quality) throws IOException { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); Condition.INST...
java
public static byte[] compressToByteArray(@NonNull final Bitmap bitmap, @NonNull final CompressFormat format, final int quality) throws IOException { Condition.INSTANCE.ensureNotNull(bitmap, "The bitmap may not be null"); ...
java
public boolean isPlanSane(Plan plan){ if (plan == null){ logger.warn("did not find plan"); return false; } if (plan.isDisabled()){ logger.debug("disabled "+ plan.getName()); return false; } if (plan.getFeedDesc() == null){ logger.warn("feed was null "+ plan.getName()); ...
java
private OnItemClickListener createItemClickListener() { return new OnItemClickListener() { @Override public void onItemClick(final AdapterView<?> parent, final View view, final int position, final long id) { Pair<Integer, Integer> item...
java
private OnItemLongClickListener createItemLongClickListener() { return new OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int position, long id) { Pair<Integer, Integer> it...
java
private int getPackedPosition(final int position) { if (position < getHeaderViewsCount()) { return position; } else { Pair<Integer, Integer> pair = getItemPosition(position - getHeaderViewsCount()); int groupIndex = pair.first; int childIndex = pair.second...
java
private int getPackedGroupPosition(final int groupIndex) { int packedPosition = getHeaderViewsCount(); if (groupIndex > 0) { for (int i = groupIndex - 1; i >= 0; i--) { packedPosition += getExpandableListAdapter().getChildrenCount(i) + 1; } } ret...
java
private Pair<Integer, Integer> getItemPosition(final int packedPosition) { int currentPosition = packedPosition; int groupIndex = -1; int childIndex = -1; int numColumns = getNumColumnsCompatible(); for (int i = 0; i < getExpandableListAdapter().getGroupCount(); i++) { ...
java
private boolean notifyOnGroupClicked(@NonNull final View view, final int groupIndex, final long id) { return groupClickListener != null && groupClickListener.onGroupClick(this, view, groupIndex, id); }
java
private boolean notifyOnChildClicked(@NonNull final View view, final int groupIndex, final int childIndex, final long id) { return childClickListener != null && childClickListener.onChildClick(this, view, groupIndex, childIndex, id); }
java
private void notifyOnItemClicked(@NonNull final View view, final int position, final long id) { if (itemClickListener != null) { itemClickListener.onItemClick(this, view, position, id); } }
java
private boolean notifyOnItemLongClicked(@NonNull final View view, final int position, final long id) { return itemLongClickListener != null && itemLongClickListener.onItemLongClick(this, view, position, id); }
java
public static int getPackedPositionType(final long packedPosition) { if (packedPosition == PACKED_POSITION_VALUE_NULL) { return PACKED_POSITION_TYPE_NULL; } return (packedPosition & PACKED_POSITION_MASK_TYPE) == PACKED_POSITION_MASK_TYPE ? PACKED_POSITION_TYPE_CHILD ...
java
public final void setAdapter(@Nullable final ExpandableListAdapter adapter) { expandedGroups.clear(); if (adapter != null) { this.adapter = new AdapterWrapper(adapter); super.setAdapter(this.adapter); } else { this.adapter = null; super.setAdapter...
java
public final boolean expandGroup(final int groupIndex) { ExpandableListAdapter adapter = getExpandableListAdapter(); if (adapter != null && !isGroupExpanded(groupIndex)) { expandedGroups.add(groupIndex); notifyDataSetChanged(); return true; } return ...
java
public final boolean collapseGroup(final int groupIndex) { ExpandableListAdapter adapter = getExpandableListAdapter(); if (adapter != null && isGroupExpanded(groupIndex)) { expandedGroups.remove(groupIndex); notifyDataSetChanged(); return true; } ret...
java
private void validateString(Class<?> clazz) throws SerializerException { if (null != clazz && !clazz.isAssignableFrom(String.class)) { throw new SerializerException("String serializer is able to work only with data types assignable from java.lang.String"); } }
java
private void validateString(Type type) throws SerializerException { if (null == type || !String.class.equals(TypeToken.of(type).getRawType())) { throw new SerializerException("String serializer is able to work only with data types assignable from java.lang.String"); } }
java
@Override public final void process(final HttpRequest request, final HttpContext context) throws HttpException, IOException { AuthState authState = (AuthState) context.getAttribute(HttpClientContext.TARGET_AUTH_STATE); if (authState.getAuthScheme() == null) { HttpHost targetHost = (Htt...
java
@Override public final <RQ, RS> Maybe<Response<RS>> executeRequest(RestCommand<RQ, RS> command) throws RestEndpointIOException { URI uri = spliceUrl(command.getUri()); HttpUriRequest rq; Serializer serializer; switch (command.getHttpMethod()) { case GET: ...
java
private Serializer getSupportedSerializer(Object o) throws SerializerException { for (Serializer s : serializers) { if (s.canWrite(o)) { return s; } } throw new SerializerException("Unable to find serializer for object with type '" + o.getClass() + "'"); ...
java
@SafeVarargs @NonNull public final Pair<View, Boolean> inflate(@NonNull final ItemType item, @Nullable final ViewGroup parent, final boolean useCache, @NonNull final ParamType.....
java