code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
private void onDocumentModified(DocumentChange change) { QueryDocumentSnapshot snapshot = change.getDocument(); if (change.getOldIndex() == change.getNewIndex()) { // Document modified only mSnapshots.set(change.getNewIndex(), snapshot); notifyOnChildChanged(ChangeEve...
@param changes metadata options for the query listen. @see #FirestoreArray(Query, SnapshotParser)
onDocumentModified
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreArray.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreArray.java
Apache-2.0
@OnLifecycleEvent(Lifecycle.Event.ON_START) public void startListening() { if (!mSnapshots.isListening(this)) { mSnapshots.addChangeEventListener(this); } }
Start listening for database changes and populate the adapter.
startListening
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@OnLifecycleEvent(Lifecycle.Event.ON_STOP) public void stopListening() { mSnapshots.removeChangeEventListener(this); }
Stop listening for database changes and clear all items in the adapter.
stopListening
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) void cleanup(LifecycleOwner source) { source.getLifecycle().removeObserver(this); }
Stop listening for database changes and clear all items in the adapter.
cleanup
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@NonNull public ObservableSnapshotArray<T> getSnapshots() { return mSnapshots; }
Returns the backing {@link ObservableSnapshotArray} used to populate this adapter. @return the backing snapshot array
getSnapshots
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@NonNull public T getItem(int position) { return mSnapshots.get(position); }
Gets the item at the specified position from the backing snapshot array. @see ObservableSnapshotArray#get(int)
getItem
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@Override public int getItemCount() { return mSnapshots.isListening(this) ? mSnapshots.size() : 0; }
Gets the size of snapshots in adapter. @return the total count of snapshots in adapter. @see ObservableSnapshotArray#size()
getItemCount
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
public void updateOptions(@NonNull FirestoreRecyclerOptions<T> options) { // Tear down old options boolean wasListening = mSnapshots.isListening(this); if (mOptions.getOwner() != null) { mOptions.getOwner().getLifecycle().removeObserver(this); } mSnapshots.clear(); ...
Re-initialize the Adapter with a new set of options. Can be used to change the query without re-constructing the entire adapter.
updateOptions
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@Override public void onChildChanged(@NonNull ChangeEventType type, @NonNull DocumentSnapshot snapshot, int newIndex, int oldIndex) { switch (type) { case ADDED: notifyItemInserted(newInd...
Re-initialize the Adapter with a new set of options. Can be used to change the query without re-constructing the entire adapter.
onChildChanged
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@Override public void onDataChanged() { }
Re-initialize the Adapter with a new set of options. Can be used to change the query without re-constructing the entire adapter.
onDataChanged
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@Override public void onError(@NonNull FirebaseFirestoreException e) { Log.w(TAG, "onError", e); }
Re-initialize the Adapter with a new set of options. Can be used to change the query without re-constructing the entire adapter.
onError
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@Override public void onBindViewHolder(@NonNull VH holder, int position) { onBindViewHolder(holder, position, getItem(position)); }
Re-initialize the Adapter with a new set of options. Can be used to change the query without re-constructing the entire adapter.
onBindViewHolder
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerAdapter.java
Apache-2.0
@NonNull public ObservableSnapshotArray<T> getSnapshots() { return mSnapshots; }
Get the {@link ObservableSnapshotArray} to observe.
getSnapshots
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public Builder<T> setSnapshotArray(@NonNull ObservableSnapshotArray<T> snapshots) { assertNull(mSnapshots, ERR_SNAPSHOTS_SET); mSnapshots = snapshots; return this; }
Directly set the {@link ObservableSnapshotArray}. <p> Do not call this method after calling {@code setQuery}.
setSnapshotArray
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull SnapshotParser<T> parser) { return setQuery(query, MetadataChanges.EXCLUDE, parser); }
Calls {@link #setQuery(Query, MetadataChanges, Class)} with metadata changes excluded.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull Class<T> modelClass) { return setQuery(query, MetadataChanges.EXCLUDE, modelClass); }
Calls {@link #setQuery(Query, MetadataChanges, Class)} with metadata changes excluded.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull MetadataChanges changes, @NonNull Class<T> modelClass) { return setQuery(query, changes, new ClassSnapshotParser<>(modelClass)); }
Set the query to use (with options) and provide a model class to which each snapshot will be converted. <p> Do not call this method after calling {@link #setSnapshotArray(ObservableSnapshotArray)}.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull MetadataChanges changes, @NonNull SnapshotParser<T> parser) { assertNull(mSnapshots, ERR_SNAPSHOTS_SET); mSnapshots = new FirestoreArray<>(query, chan...
Set the query to use (with options) and provide a custom {@link SnapshotParser}. <p> Do not call this method after calling {@link #setSnapshotArray(ObservableSnapshotArray)}.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public Builder<T> setLifecycleOwner(@Nullable LifecycleOwner owner) { mOwner = owner; return this; }
Set a {@link LifecycleOwner} for the adapter. Listening will stop/start after the appropriate lifecycle events.
setLifecycleOwner
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@NonNull public FirestoreRecyclerOptions<T> build() { assertNonNull(mSnapshots, ERR_SNAPSHOTS_NULL); return new FirestoreRecyclerOptions<>(mSnapshots, mOwner); }
Build a {@link FirestoreRecyclerOptions} from the provided arguments.
build
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/FirestoreRecyclerOptions.java
Apache-2.0
@Override public boolean areItemsTheSame(@NonNull DocumentSnapshot oldItem, @NonNull DocumentSnapshot newItem) { return oldItem.getId().equals(newItem.getId()); }
Default diff callback implementation for Firestore snapshots.
areItemsTheSame
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/DefaultSnapshotDiffCallback.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/DefaultSnapshotDiffCallback.java
Apache-2.0
@SuppressLint("DiffUtilEquals") @Override public boolean areContentsTheSame(@NonNull DocumentSnapshot oldItem, @NonNull DocumentSnapshot newItem) { T oldModel = mParser.parseSnapshot(oldItem); T newModel = mParser.parseSnapshot(newItem); return oldM...
Default diff callback implementation for Firestore snapshots.
areContentsTheSame
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/DefaultSnapshotDiffCallback.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/DefaultSnapshotDiffCallback.java
Apache-2.0
@Override public void onChanged(@Nullable PagingData<DocumentSnapshot> snapshots) { if (snapshots == null) { return; } submitData(mOptions.getOwner().getLifecycle(), snapshots); }
Paginated RecyclerView Adapter for a Cloud Firestore query. Configured with {@link FirestorePagingOptions}.
onChanged
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
Apache-2.0
public void updateOptions(@NonNull FirestorePagingOptions<T> options) { mOptions = options; // Tear down old options boolean hasObservers = mSnapshots.hasObservers(); if (mOptions.getOwner() != null) { mOptions.getOwner().getLifecycle().removeObserver(this); } ...
Re-initialize the Adapter with a new set of options. Can be used to change the query without re-constructing the entire adapter.
updateOptions
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
Apache-2.0
@OnLifecycleEvent(Lifecycle.Event.ON_START) public void startListening() { mSnapshots.observeForever(mDataObserver); }
Start listening to paging / scrolling events and populating adapter data.
startListening
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
Apache-2.0
@OnLifecycleEvent(Lifecycle.Event.ON_STOP) public void stopListening() { mSnapshots.removeObserver(mDataObserver); }
Unsubscribe from paging / scrolling events, no more data will be populated, but the existing data will remain.
stopListening
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
Apache-2.0
@Override public void onBindViewHolder(@NonNull VH holder, int position) { DocumentSnapshot snapshot = getItem(position); onBindViewHolder(holder, position, mParser.parseSnapshot(snapshot)); }
Unsubscribe from paging / scrolling events, no more data will be populated, but the existing data will remain.
onBindViewHolder
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingAdapter.java
Apache-2.0
@NonNull public LiveData<PagingData<DocumentSnapshot>> getPagingData() { return mPagingData; }
Options to configure an {@link FirestorePagingAdapter}. <p> Use {@link Builder} to create a new instance.
getPagingData
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public SnapshotParser<T> getParser() { return mParser; }
Options to configure an {@link FirestorePagingAdapter}. <p> Use {@link Builder} to create a new instance.
getParser
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public DiffUtil.ItemCallback<DocumentSnapshot> getDiffCallback() { return mDiffCallback; }
Options to configure an {@link FirestorePagingAdapter}. <p> Use {@link Builder} to create a new instance.
getDiffCallback
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@Nullable public LifecycleOwner getOwner() { return mOwner; }
Options to configure an {@link FirestorePagingAdapter}. <p> Use {@link Builder} to create a new instance.
getOwner
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setPagingData(@NonNull LiveData<PagingData<DocumentSnapshot>> data, @NonNull Class<T> modelClass) { return setPagingData(data, new ClassSnapshotParser<>(modelClass)); }
Directly set data using and parse with a {@link ClassSnapshotParser} based on the given class. <p> Do not call this method after calling {@code setQuery}.
setPagingData
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setPagingData(@NonNull LiveData<PagingData<DocumentSnapshot>> pagingData, @NonNull SnapshotParser<T> parser) { assertNull(mPagingData, ERR_DATA_SET); mPagingData = pagingData; mParser = parser; re...
Directly set data and parse with a custom {@link SnapshotParser}. <p> Do not call this method after calling {@code setQuery}.
setPagingData
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull PagingConfig config, @NonNull Class<T> modelClass) { return setQuery(query, Source.DEFAULT, config, modelClass); }
Sets the query using {@link Source#DEFAULT} and a {@link ClassSnapshotParser} based on the given Class. <p> See {@link #setQuery(Query, Source, PagingConfig, SnapshotParser)}.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull PagingConfig config, @NonNull SnapshotParser<T> parser) { return setQuery(query, Source.DEFAULT, config, parser); }
Sets the query using {@link Source#DEFAULT} and a custom {@link SnapshotParser}. <p> See {@link #setQuery(Query, Source, PagingConfig, SnapshotParser)}.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setQuery(@NonNull Query query, @NonNull Source source, @NonNull PagingConfig config, @NonNull Class<T> modelClass) { return setQuery(query, source, config, new ClassSna...
Sets the query using a custom {@link Source} and a {@link ClassSnapshotParser} based on the given class. <p> See {@link #setQuery(Query, Source, PagingConfig, SnapshotParser)}.
setQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setDiffCallback(@NonNull DiffUtil.ItemCallback<DocumentSnapshot> diffCallback) { mDiffCallback = diffCallback; return this; }
Sets an optional custom {@link DiffUtil.ItemCallback} to compare {@link DocumentSnapshot} objects. <p> The default implementation is {@link DefaultSnapshotDiffCallback}. @return this, for chaining.
setDiffCallback
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Builder<T> setLifecycleOwner(@NonNull LifecycleOwner owner) { mOwner = owner; return this; }
Sets an optional {@link LifecycleOwner} to control the lifecycle of the adapter. Otherwise, you must manually call {@link FirestorePagingAdapter#startListening()} and {@link FirestorePagingAdapter#stopListening()}. @return this, for chaining.
setLifecycleOwner
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/FirestorePagingOptions.java
Apache-2.0
@NonNull public Query getPageQuery(@NonNull Query baseQuery, int size) { Query pageQuery = baseQuery; if (mStartAfter != null) { pageQuery = pageQuery.startAfter(mStartAfter); } if (mEndBefore != null) { pageQuery = pageQuery.endBefore(mEndBefore); }...
Key for Firestore pagination. Holds the DocumentSnapshot(s) that bound the page.
getPageQuery
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/PageKey.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/PageKey.java
Apache-2.0
@Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; PageKey key = (PageKey) o; if (mStartAfter == null && key.mStartAfter == null && mEndBefore == null && key.mEndBefore == null) ...
Key for Firestore pagination. Holds the DocumentSnapshot(s) that bound the page.
equals
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/PageKey.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/PageKey.java
Apache-2.0
@Override @NonNull public String toString() { String startAfter = mStartAfter == null ? null : mStartAfter.getId(); String endBefore = mEndBefore == null ? null : mEndBefore.getId(); return "PageKey{" + "StartAfter=" + startAfter + ", EndBefore=" + endBefo...
Key for Firestore pagination. Holds the DocumentSnapshot(s) that bound the page.
toString
java
firebase/FirebaseUI-Android
firestore/src/main/java/com/firebase/ui/firestore/paging/PageKey.java
https://github.com/firebase/FirebaseUI-Android/blob/master/firestore/src/main/java/com/firebase/ui/firestore/paging/PageKey.java
Apache-2.0
@Override public FeatureState getFeatureState(Feature feature) { try { GetObjectRequest.Builder requestBuilder = GetObjectRequest.builder() .bucket(bucketName) .key(keyPrefix + feature.name()); if (sseCustomerAlgorithm != null) { ...
A state repository that uses Amazon S3. <p> The repository is configured using the {@link Builder} <p> You must already have a bucket provisioned before you create this repository. @author Mark Richardson
getFeatureState
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
@Override public void setFeatureState(FeatureState featureState) { try { FeatureStateStorageWrapper storageWrapper = FeatureStateStorageWrapper.wrapperForFeatureState(featureState); String json = objectMapper.writeValueAsString(storageWrapper); PutObjectRequest.Builder r...
A state repository that uses Amazon S3. <p> The repository is configured using the {@link Builder} <p> You must already have a bucket provisioned before you create this repository. @author Mark Richardson
setFeatureState
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
String getSseCustomerAlgorithm() { return sseCustomerAlgorithm; }
A state repository that uses Amazon S3. <p> The repository is configured using the {@link Builder} <p> You must already have a bucket provisioned before you create this repository. @author Mark Richardson
getSseCustomerAlgorithm
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
String getSseCustomerKey() { return sseCustomerKey; }
A state repository that uses Amazon S3. <p> The repository is configured using the {@link Builder} <p> You must already have a bucket provisioned before you create this repository. @author Mark Richardson
getSseCustomerKey
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
String getSseCustomerKeyMD5() { return sseCustomerKeyMD5; }
A state repository that uses Amazon S3. <p> The repository is configured using the {@link Builder} <p> You must already have a bucket provisioned before you create this repository. @author Mark Richardson
getSseCustomerKeyMD5
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
String getKeyPrefix() { return keyPrefix; }
A state repository that uses Amazon S3. <p> The repository is configured using the {@link Builder} <p> You must already have a bucket provisioned before you create this repository. @author Mark Richardson
getKeyPrefix
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
public static Builder newBuilder(S3Client client, String bucketName) { return new Builder(client, bucketName); }
Creates a new builder for creating a {@link S3StateRepository}. @param client the client instance to use for connecting to amazon s3 @param bucketName The name of the bucket to use @return a Builder
newBuilder
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
public Builder prefix(String keyPrefix) { this.keyPrefix = keyPrefix == null ? "" : keyPrefix; return this; }
Optional prefixes to prepend on to each key @param keyPrefix The prefix to use @return this
prefix
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
public S3StateRepository build() { return new S3StateRepository(this); }
Creates a new {@link S3StateRepository} using the current settings.
build
java
togglz/togglz
amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
https://github.com/togglz/togglz/blob/master/amazon-s3/src/main/java/org/togglz/s3/S3StateRepository.java
Apache-2.0
public FeatureState getState() { return state; }
This class represents a cached repository lookup
getState
java
togglz/togglz
appengine/src/main/java/org/togglz/appengine/repository/MemcacheStateRepository.java
https://github.com/togglz/togglz/blob/master/appengine/src/main/java/org/togglz/appengine/repository/MemcacheStateRepository.java
Apache-2.0
static DelegateDatastoreService getInstance(DatastoreService delegate) { return new DelegateDatastoreService(delegate); }
Non final implementation of DatastoreService to allow Mockito.Spy
getInstance
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Entity get(Key key) throws EntityNotFoundException { return delegate.get(key); }
Non final implementation of DatastoreService to allow Mockito.Spy
get
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public PreparedQuery prepare(Transaction transaction, Query query) { return delegate.prepare(transaction, query); }
Non final implementation of DatastoreService to allow Mockito.Spy
prepare
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Transaction getCurrentTransaction() { return delegate.getCurrentTransaction(); }
Non final implementation of DatastoreService to allow Mockito.Spy
getCurrentTransaction
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public PreparedQuery prepare(Query query) { return delegate.prepare(query); }
Non final implementation of DatastoreService to allow Mockito.Spy
prepare
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public KeyRange allocateIds(String s, long l) { return delegate.allocateIds(s, l); }
Non final implementation of DatastoreService to allow Mockito.Spy
allocateIds
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Collection<Transaction> getActiveTransactions() { return delegate.getActiveTransactions(); }
Non final implementation of DatastoreService to allow Mockito.Spy
getActiveTransactions
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Entity get(Transaction transaction, Key key) throws EntityNotFoundException { return delegate.get(transaction, key); }
Non final implementation of DatastoreService to allow Mockito.Spy
get
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Map<Key, Entity> get(Transaction transaction, Iterable<Key> iterable) { return delegate.get(transaction, iterable); }
Non final implementation of DatastoreService to allow Mockito.Spy
get
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Map<Key, Entity> get(Iterable<Key> iterable) { return delegate.get(iterable); }
Non final implementation of DatastoreService to allow Mockito.Spy
get
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Key put(Transaction transaction, Entity entity) { return delegate.put(transaction, entity); }
Non final implementation of DatastoreService to allow Mockito.Spy
put
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public void delete(Transaction transaction, Iterable<Key> iterable) { delegate.delete(transaction, iterable); }
Non final implementation of DatastoreService to allow Mockito.Spy
delete
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Map<Index, Index.IndexState> getIndexes() { return delegate.getIndexes(); }
Non final implementation of DatastoreService to allow Mockito.Spy
getIndexes
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public DatastoreAttributes getDatastoreAttributes() { return delegate.getDatastoreAttributes(); }
Non final implementation of DatastoreService to allow Mockito.Spy
getDatastoreAttributes
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Transaction beginTransaction(TransactionOptions transactionOptions) { return delegate.beginTransaction(transactionOptions); }
Non final implementation of DatastoreService to allow Mockito.Spy
beginTransaction
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Key put(Entity entity) { return delegate.put(entity); }
Non final implementation of DatastoreService to allow Mockito.Spy
put
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Transaction getCurrentTransaction(Transaction transaction) { return delegate.getCurrentTransaction(transaction); }
Non final implementation of DatastoreService to allow Mockito.Spy
getCurrentTransaction
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public DatastoreService.KeyRangeState allocateIdRange(KeyRange keyRange) { return delegate.allocateIdRange(keyRange); }
Non final implementation of DatastoreService to allow Mockito.Spy
allocateIdRange
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public KeyRange allocateIds(Key key, String s, long l) { return delegate.allocateIds(key, s, l); }
Non final implementation of DatastoreService to allow Mockito.Spy
allocateIds
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public List<Key> put(Iterable<Entity> iterable) { return delegate.put(iterable); }
Non final implementation of DatastoreService to allow Mockito.Spy
put
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public List<Key> put(Transaction transaction, Iterable<Entity> iterable) { return delegate.put(transaction, iterable); }
Non final implementation of DatastoreService to allow Mockito.Spy
put
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public Transaction beginTransaction() { return delegate.beginTransaction(); }
Non final implementation of DatastoreService to allow Mockito.Spy
beginTransaction
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public void delete(Transaction transaction, Key... keys) { delegate.delete(transaction, keys); }
Non final implementation of DatastoreService to allow Mockito.Spy
delete
java
togglz/togglz
appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
https://github.com/togglz/togglz/blob/master/appengine/src/test/java/org/togglz/appengine/repository/DelegateDatastoreService.java
Apache-2.0
public String get() { super.checkTogglzState(); return delegate.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
get
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
public String get() { return featureManager.isActive(feature) ? active.get() : inactive.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
get
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@SuppressWarnings("unchecked") @Setup(Level.Trial) public void setupFeatureManager() { // create an in-memory state repository for our feature featureManager = new FeatureManagerBuilder() .featureEnums(ProxyFeature.class) .stateRepository(new InMemoryStateRepository()) .userProvider(new N...
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
setupFeatureManager
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@Benchmark // Full auto-generated proxy public String activeProxy() { return proxy.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
activeProxy
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@Benchmark // Full auto-generated passive proxy public String passiveProxy() { return passiveProxy.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
passiveProxy
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@Benchmark // Same design as the auto-generated code to highlight any inefficiency in ByteBuddy solution. public String handCodedTogglzSwitchable() { return handCoded.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
handCodedTogglzSwitchable
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@Benchmark // A common style of hand-coded solution public String handCodedSwitch() { return handCoded2.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
handCodedSwitch
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@Benchmark // Baseline performance of calling the targeted object directly public String directCall() { return sayHello.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
directCall
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(ByteBuddyProxyBenchmark.class.getSimpleName()) .forks(1) .build(); new Runner(opt).run(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
main
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/ByteBuddyProxyBenchmark.java
Apache-2.0
@Override public StateRepository initializeStateRepository() throws Exception { return new CachingStateRepository(new InMemoryStateRepository()); }
Test the performance of the CachingStateRepository when placed in front of an InMemoryStateRepository to see what the overhead of the CachingStateRepository is. @author Ryan Gardner @date 5/31/16
initializeStateRepository
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/CachingStateRepositoryBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/CachingStateRepositoryBenchmark.java
Apache-2.0
public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(CachingStateRepositoryBenchmark.class.getSimpleName()) .build(); new Runner(opt).run(); }
Test the performance of the CachingStateRepository when placed in front of an InMemoryStateRepository to see what the overhead of the CachingStateRepository is. @author Ryan Gardner @date 5/31/16
main
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/CachingStateRepositoryBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/CachingStateRepositoryBenchmark.java
Apache-2.0
@Setup(Level.Trial) public void setupFeatureManager() { FeatureManager featureManager = new FeatureManagerBuilder() .featureEnums(ReleaseDateBenchmarkFeature.class) .stateRepository(new InMemoryStateRepository()) .userProvider(new NoOpUserProvider()) ...
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
setupFeatureManager
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
@Benchmark public int releaseDateStrategyEnabled() { return (manager.isActive(ReleaseDateBenchmarkFeature.RELEASE_DATE_STRATEGY_ENABLED)) ? 0 : 1; }
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
releaseDateStrategyEnabled
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
@Benchmark public int releaseDateStrategyConfiguredButNotEnabled() { return (manager.isActive(ReleaseDateBenchmarkFeature.RELEASE_DATE_STRATEGY_DISABLED)) ? 0 : 1; }
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
releaseDateStrategyConfiguredButNotEnabled
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
@Benchmark public int noFeatureStateSetBaseline() { return (manager.isActive(ReleaseDateBenchmarkFeature.NO_STATE_CONFIGURED)) ? 0 : 1; }
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
noFeatureStateSetBaseline
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
@Benchmark public int disabledByAFeatureStateExplicitly() { return (manager.isActive(ReleaseDateBenchmarkFeature.DISABLED_BY_FEATURE_STATE)) ? 0 : 1; }
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
disabledByAFeatureStateExplicitly
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
@Benchmark public int enabledByDefaultByAnAnnotation() { return (manager.isActive(ReleaseDateBenchmarkFeature.ENABLED_BY_DEFAULT)) ? 0 : 1; }
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
enabledByDefaultByAnAnnotation
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(FeatureStateBenchmarks.class.getSimpleName()) .build(); new Runner(opt).run(); }
Benchmark the performance of using an ActivationStrategy on the performance of a Togglz switch @author Ryan Gardner @date 5/12/16
main
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/FeatureStateBenchmarks.java
Apache-2.0
@Override public StateRepository initializeStateRepository() throws Exception { return new InMemoryStateRepository(); }
A benchmark around the "InMemory" state repository. @author Ryan Gardner @date 5/31/16
initializeStateRepository
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/InMemoryStateRepositoryBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/InMemoryStateRepositoryBenchmark.java
Apache-2.0
public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(InMemoryStateRepository.class.getSimpleName()) .build(); new Runner(opt).run(); }
A benchmark around the "InMemory" state repository. @author Ryan Gardner @date 5/31/16
main
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/InMemoryStateRepositoryBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/InMemoryStateRepositoryBenchmark.java
Apache-2.0
@SuppressWarnings("unchecked") @Setup(Level.Trial) public void setupFeatureManager() { // create an in-memory state repository for our feature featureManager = new FeatureManagerBuilder() .featureEnums(ProxyFeature.class) .stateRepository(new InMemoryStateRepository()) .userProvider(new N...
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
setupFeatureManager
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
Apache-2.0
@Benchmark public String proxyCall() { return proxy.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
proxyCall
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
Apache-2.0
@Benchmark public String directCall() { return sayHello.get(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
directCall
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
Apache-2.0
public static void main(String[] args) throws RunnerException { Options opt = new OptionsBuilder() .include(JdkProxyBenchmark.class.getSimpleName()) .forks(1) .build(); new Runner(opt).run(); }
Compare the overhead of togglz JDK Proxy with an in-memory state repository vs a direct call
main
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/JdkProxyBenchmark.java
Apache-2.0
@Override public StateRepository initializeStateRepository() throws IOException { tempFile = File.createTempFile(this.getClass().getSimpleName(), null); return new FileBasedStateRepository(tempFile); }
Basic benchmark of the performance of the PropertyBasedStateRepository @author Ryan Gardner @date 5/26/16
initializeStateRepository
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/PropertyBasedStateRepositoryBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/PropertyBasedStateRepositoryBenchmark.java
Apache-2.0
@Override public void cleanupStateRepository() { tempFile.delete(); }
Basic benchmark of the performance of the PropertyBasedStateRepository @author Ryan Gardner @date 5/26/16
cleanupStateRepository
java
togglz/togglz
benchmarks/src/main/java/org/togglz/benchmark/PropertyBasedStateRepositoryBenchmark.java
https://github.com/togglz/togglz/blob/master/benchmarks/src/main/java/org/togglz/benchmark/PropertyBasedStateRepositoryBenchmark.java
Apache-2.0