-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved build process (fixed leaking dependencies). Removed extra dependency on appcompat.
- Loading branch information
Showing
9 changed files
with
112 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 0 additions & 3 deletions
3
core/src/main/java/eu/darken/rxshell/extra/HasEnvironmentVariables.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
/* | ||
* Copyright (C) 2009 The Android Open Source Project | ||
* | ||
* 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 in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package eu.darken.rxshell.extra; | ||
|
||
import android.support.annotation.NonNull; | ||
import android.support.annotation.Nullable; | ||
|
||
/** | ||
* Container to ease passing around a tuple of two objects. This object provides a sensible | ||
* implementation of equals(), returning true if equals() is true on each of the contained | ||
* objects. | ||
*/ | ||
public class Pair<F, S> { | ||
public final @Nullable F first; | ||
public final @Nullable S second; | ||
|
||
/** | ||
* Constructor for a Pair. | ||
* | ||
* @param first the first object in the Pair | ||
* @param second the second object in the pair | ||
*/ | ||
public Pair(@Nullable F first, @Nullable S second) { | ||
this.first = first; | ||
this.second = second; | ||
} | ||
|
||
/** | ||
* Checks the two objects for equality by delegating to their respective | ||
* {@link Object#equals(Object)} methods. | ||
* | ||
* @param o the {@link Pair} to which this one is to be checked for equality | ||
* @return true if the underlying objects of the Pair are both considered | ||
* equal | ||
*/ | ||
@Override | ||
public boolean equals(Object o) { | ||
if (!(o instanceof Pair)) return false; | ||
|
||
Pair<?, ?> p = (Pair<?, ?>) o; | ||
return objectsEqual(p.first, first) && objectsEqual(p.second, second); | ||
} | ||
|
||
private static boolean objectsEqual(Object a, Object b) { | ||
return a == b || (a != null && a.equals(b)); | ||
} | ||
|
||
/** | ||
* Compute a hash code using the hash codes of the underlying objects | ||
* | ||
* @return a hashcode of the Pair | ||
*/ | ||
@Override | ||
public int hashCode() { | ||
return (first == null ? 0 : first.hashCode()) ^ (second == null ? 0 : second.hashCode()); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Pair{" + String.valueOf(first) + " " + String.valueOf(second) + "}"; | ||
} | ||
|
||
/** | ||
* Convenience method for creating an appropriately typed pair. | ||
* | ||
* @param a the first object in the Pair | ||
* @param b the second object in the pair | ||
* @return a Pair that is templatized with the types of a and b | ||
*/ | ||
@NonNull | ||
public static <A, B> Pair<A, B> create(@Nullable A a, @Nullable B b) { | ||
return new Pair<>(a, b); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#Mon Nov 06 20:03:29 CET 2017 | ||
#Fri Apr 27 02:03:03 CEST 2018 | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters