Skip to content

Commit

Permalink
Move android specific classes into the corresponding parent package
Browse files Browse the repository at this point in the history
  • Loading branch information
Mykola Mokhnach committed Feb 8, 2018
1 parent 438af22 commit fe63a94
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

package io.appium.java_client.appmanagement;
package io.appium.java_client.android.appmanagement;

import com.google.common.collect.ImmutableMap;
import io.appium.java_client.appmanagement.BaseInstallApplicationOptions;

import java.time.Duration;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

package io.appium.java_client.appmanagement;
package io.appium.java_client.android.appmanagement;

import com.google.common.collect.ImmutableMap;
import io.appium.java_client.appmanagement.BaseRemoveApplicationOptions;

import java.time.Duration;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

package io.appium.java_client.appmanagement;
package io.appium.java_client.android.appmanagement;

import com.google.common.collect.ImmutableMap;
import io.appium.java_client.appmanagement.BaseTerminateApplicationOptions;

import java.time.Duration;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,8 @@
import java.util.Arrays;

public enum ApplicationState {
NOT_INSTALLED(0), NOT_RUNNING(1), RUNNING_IN_BACKGROUND_SUSPENDED(2),
RUNNING_IN_BACKGROUND(3), RUNNING_IN_FOREGROUND(4);

private int code;

ApplicationState(int code) {
this.code = code;
}
NOT_INSTALLED, NOT_RUNNING, RUNNING_IN_BACKGROUND_SUSPENDED,
RUNNING_IN_BACKGROUND, RUNNING_IN_FOREGROUND;

/**
* Creates {@link ApplicationState} instance based on the code.
Expand All @@ -36,7 +30,7 @@ public enum ApplicationState {
*/
public static ApplicationState ofCode(int code) {
return Arrays.stream(ApplicationState.values())
.filter(x -> code == x.code)
.filter(x -> code == x.ordinal())
.findFirst()
.orElseThrow(() -> new IllegalArgumentException(
String.format("Application state %s is unknown", code))
Expand Down

0 comments on commit fe63a94

Please sign in to comment.