private void testCase(Object o1, Object o2, Object o3, Object o4, Object o5, Object o6) { assertEquals( Objects.hashCode(o1), HashCodeUtil.hashCode(o1)); assertEquals( Objects.hashCode(o1, o2), HashCodeUtil.hashCode(o1, o2)); assertEquals( Objects.hashCode(o1, o2, o3), HashCodeUtil.hashCode(o1, o2, o3)); assertEquals( Objects.hashCode(o1, o2, o3, o4), HashCodeUtil.hashCode(o1, o2, o3, o4)); assertEquals( Objects.hashCode(o1, o2, o3, o4, o5), HashCodeUtil.hashCode(o1, o2, o3, o4, o5)); assertEquals( Objects.hashCode(o1, o2, o3, o4, o5, o6), HashCodeUtil.hashCode(o1, o2, o3, o4, o5, o6)); }
/** * Returns a DataSource supplier that will on get submit the request for execution and return a * DataSource representing the pending results of the task. * * @param imageRequest the request to submit (what to execute). * @param callerContext the caller context of the caller of data source supplier * @param requestLevel which level to look down until for the image * @return a DataSource representing pending results and completion of the request */ public Supplier<DataSource<CloseableReference<CloseableImage>>> getDataSourceSupplier( final ImageRequest imageRequest, final Object callerContext, final ImageRequest.RequestLevel requestLevel) { return new Supplier<DataSource<CloseableReference<CloseableImage>>>() { @Override public DataSource<CloseableReference<CloseableImage>> get() { return fetchDecodedImage(imageRequest, callerContext, requestLevel); } @Override public String toString() { return Objects.toStringHelper(this) .add("uri", imageRequest.getSourceUri()) .toString(); } }; }
/** * Returns a DataSource supplier that will on get submit the request for execution and return a * DataSource representing the pending results of the task. * * @param imageRequest the request to submit (what to execute). * @return a DataSource representing pending results and completion of the request */ public Supplier<DataSource<CloseableReference<PooledByteBuffer>>> getEncodedImageDataSourceSupplier( final ImageRequest imageRequest, final Object callerContext) { return new Supplier<DataSource<CloseableReference<PooledByteBuffer>>>() { @Override public DataSource<CloseableReference<PooledByteBuffer>> get() { return fetchEncodedImage(imageRequest, callerContext); } @Override public String toString() { return Objects.toStringHelper(this) .add("uri", imageRequest.getSourceUri()) .toString(); } }; }
/** Creates a data source supplier for the given image request. */ protected Supplier<DataSource<IMAGE>> getDataSourceSupplierForRequest( final REQUEST imageRequest, final CacheLevel cacheLevel) { final Object callerContext = getCallerContext(); return new Supplier<DataSource<IMAGE>>() { @Override public DataSource<IMAGE> get() { return getDataSourceForRequest(imageRequest, callerContext, cacheLevel); } @Override public String toString() { return Objects.toStringHelper(this) .add("request", imageRequest.toString()) .toString(); } }; }
@Override public String toString() { return Objects.toStringHelper(this) .add("super", super.toString()) .add("dataSourceSupplier", mDataSourceSupplier) .toString(); }
@Override public String toString() { return Objects.toStringHelper(this) .add("imageCacheKey", mImageCacheKey) .add("frameIndex", mFrameIndex) .toString(); }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof IncreasingQualityDataSourceSupplier)) { return false; } IncreasingQualityDataSourceSupplier that = (IncreasingQualityDataSourceSupplier) other; return Objects.equal(this.mDataSourceSuppliers, that.mDataSourceSuppliers); }
@Override public boolean equals(Object other) { if (other == this) { return true; } if (!(other instanceof FirstAvailableDataSourceSupplier)) { return false; } FirstAvailableDataSourceSupplier that = (FirstAvailableDataSourceSupplier) other; return Objects.equal(this.mDataSourceSuppliers, that.mDataSourceSuppliers); }
@Override public boolean equals(Object o) { if (!(o instanceof MediaVariations)) { return false; } MediaVariations otherVariations = (MediaVariations) o; return Objects.equal(mMediaId, otherVariations.mMediaId) && mForceRequestForSpecifiedUri == otherVariations.mForceRequestForSpecifiedUri && Objects.equal(mVariants, otherVariations.mVariants); }
@Override public boolean equals(Object o) { if (!(o instanceof Variant)) { return false; } Variant otherVariant = (Variant) o; return Objects.equal(mUri, otherVariant.mUri) && mWidth == otherVariant.mWidth && mHeight == otherVariant.mHeight && mCacheChoice == otherVariant.mCacheChoice; }
@Override public boolean equals(Object o) { if (!(o instanceof ImageRequest)) { return false; } ImageRequest request = (ImageRequest) o; return Objects.equal(mSourceUri, request.mSourceUri) && Objects.equal(mCacheChoice, request.mCacheChoice) && Objects.equal(mMediaVariations, request.mMediaVariations) && Objects.equal(mSourceFile, request.mSourceFile); }
@Override public String toString() { return Objects.toStringHelper(this) .add("uri", mSourceUri) .add("cacheChoice", mCacheChoice) .add("decodeOptions", mImageDecodeOptions) .add("postprocessor", mPostprocessor) .add("priority", mRequestPriority) .add("resizeOptions", mResizeOptions) .add("rotationOptions", mRotationOptions) .add("bytesRange", mBytesRange) .add("mediaVariations", mMediaVariations) .toString(); }
@Override public boolean equals(Object o) { if (!(o instanceof BitmapMemoryCacheKey)) { return false; } BitmapMemoryCacheKey otherKey = (BitmapMemoryCacheKey) o; return mHash == otherKey.mHash && mSourceString.equals(otherKey.mSourceString) && Objects.equal(this.mResizeOptions, otherKey.mResizeOptions) && Objects.equal(this.mRotationOptions, otherKey.mRotationOptions) && Objects.equal(mImageDecodeOptions, otherKey.mImageDecodeOptions) && Objects.equal(mPostprocessorCacheKey, otherKey.mPostprocessorCacheKey) && Objects.equal(mPostprocessorName, otherKey.mPostprocessorName); }
@Override public String toString() { return Objects.toStringHelper(this) .add("controllerAttached", mIsControllerAttached) .add("holderAttached", mIsHolderAttached) .add("drawableVisible", mIsVisible) .add("events", mEventTracker.toString()) .toString(); }
/** * Sets the scale type. * @param scaleType scale type to set */ public void setScaleType(ScaleType scaleType) { if (Objects.equal(mScaleType, scaleType)) { return; } mScaleType = scaleType; mScaleTypeState = null; configureBounds(); invalidateSelf(); }
@Override public String toString() { return Objects.toStringHelper(this) .add("isAttached", mIsAttached) .add("isRequestSubmitted", mIsRequestSubmitted) .add("hasFetchFailed", mHasFetchFailed) .add("fetchedImage", getImageHash(mFetchedImage)) .add("events", mEventTracker.toString()) .toString(); }
/** * Sets the focus point. * If ScaleType.FOCUS_CROP is used, focus point will attempted to be centered within a view. * Each coordinate is a real number in [0,1] range, in the coordinate system where top-left * corner of the image corresponds to (0, 0) and the bottom-right corner corresponds to (1, 1). * @param focusPoint focus point of the image */ public void setFocusPoint(PointF focusPoint) { if (Objects.equal(mFocusPoint, focusPoint)) { return; } if (mFocusPoint == null) { mFocusPoint = new PointF(); } mFocusPoint.set(focusPoint); configureBounds(); invalidateSelf(); }
@Override public String toString() { return Objects.toStringHelper(this) .add("list", mDataSourceSuppliers) .toString(); }
@Override public int hashCode() { return Objects.hashCode(mMediaId, mForceRequestForSpecifiedUri, mVariants, mSource); }
@Override public int hashCode() { return Objects.hashCode(mCacheChoice, mSourceUri, mMediaVariations, mSourceFile); }
@Override public int hashCode() { return Objects.hashCode(a, b); }