Skip to content

Commit

Permalink
Merge pull request #56 from lalwani/gradle
Browse files Browse the repository at this point in the history
switching to mavenCentral since jcenter is not operational anymore
  • Loading branch information
lalwani authored May 6, 2023
2 parents 35b0c18 + c6cbcc1 commit 066a1de
Show file tree
Hide file tree
Showing 6 changed files with 93 additions and 46 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@

name: Java CI with Gradle

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
on: [push, pull_request]

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ buildscript {
apply from: 'gradle/dependencies.gradle'

repositories {
jcenter()
mavenCentral()
maven { url deps.build.repositories.plugins }
}
dependencies {
Expand Down
4 changes: 2 additions & 2 deletions gradle/verification.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
subprojects {
buildscript {
repositories {
jcenter()
mavenCentral()
}
}

repositories {
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com'
}
Expand Down
2 changes: 1 addition & 1 deletion samples/servlet-sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ sourceCompatibility = JavaVersion.VERSION_1_7
mainClassName = 'com.uber.sdk.rides.samples.servlet.Server'

repositories {
jcenter()
mavenCentral()
}

dependencies {
Expand Down
29 changes: 14 additions & 15 deletions uber-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
buildscript {
repositories {
jcenter()
mavenCentral()
maven { url deps.build.repositories.plugins }
}
dependencies {
Expand All @@ -43,21 +43,20 @@ buildConfig {
}

dependencies {
compile deps.network.retrofit
compile deps.network.retrofitMoshiConverter
compile deps.network.moshi
compile deps.network.okhttp
compile deps.network.okhttpLoggingInterceptor
compile deps.misc.jsr305

implementation deps.network.retrofit
implementation deps.network.retrofitMoshiConverter
implementation deps.network.moshi
implementation deps.network.okhttp
implementation deps.network.okhttpLoggingInterceptor
implementation deps.misc.jsr305

testImplementation deps.test.junit
testImplementation deps.test.assertj
testImplementation deps.test.mockito
testImplementation deps.test.hamcrest
testImplementation deps.test.wiremock
testImplementation deps.network.retrofit
testImplementation deps.network.okhttp
testCompile deps.test.junit
testCompile deps.test.assertj
testCompile deps.test.mockito
testCompile deps.test.hamcrest
testCompile deps.test.wiremock
testCompile deps.network.retrofit
testCompile deps.network.okhttp
}

apply from: rootProject.file('gradle/gradle-mvn-push.gradle')
96 changes: 74 additions & 22 deletions uber-core/src/main/java/com/uber/sdk/core/auth/ProfileHint.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,55 @@

import javax.annotation.Nonnull;

public class ProfileHint implements Serializable {

@Json(name = "first_name")
private final String firstName;
@Json(name = "last_name")
private final String lastName;
@Json(name = "email")
private final String email;
@Json(name = "phone")
private final String phone;

private ProfileHint(
String firstName,
String lastName,
String email,
String phone) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.phone = phone;
}

/**
* {@Link #ProfileHint} is builder to setup user's personal information like phone number, email
* firstName and lastName
*/
final public class ProfileHint implements Serializable {
/**
* Builder class for {@link ProfileHint}
*/
public static class Builder {
private String firstName;
private String lastName;
private String email;
private String phone;

/**
* Set first name
*
* @param firstName first name of the user
*/
public Builder firstName(@Nonnull String firstName) {
this.firstName = firstName;
return this;
}

/**
* Set last name
*
* @param lastName last name of the user
*/
public Builder lastName(@Nonnull String lastName) {
this.lastName = lastName;
return this;
}

/**
* Set email address
*
* @param email email address of the user
*/
public Builder email(@Nonnull String email) {
this.email = email;
return this;
}

/**
* Set phone number as a string including country code
*
* @param phone phone number of the user
*/
public Builder phone(@Nonnull String phone) {
this.phone = phone;
return this;
Expand All @@ -63,27 +70,72 @@ public ProfileHint build() {
}
}

/**
* Gets the first name of the user
*
* @return The first name of the user if set, null otherwise
*/
public String getFirstName() {
return firstName;
}

/**
* Gets the last name of the user
*
* @return The last name of the user if set, null otherwise
*/
public String getLastName() {
return lastName;
}

/**
* Gets the email address of the user
*
* @return The email address of the user if set, null otherwise
*/
public String getEmail() {
return email;
}

/**
* Gets the phone number of the user as a string including country code
*
* @return The phone number of the user if set, null otherwise
*/
public String getPhone() {
return phone;
}

/**
* Returns new Builder with the current instance's properties as default values
*
* @return a new Builder object
*/
public Builder newBuilder() {
return new Builder()
.firstName(firstName)
.lastName(lastName)
.email(email)
.phone(phone);
}

@Json(name = "first_name")
private final String firstName;
@Json(name = "last_name")
private final String lastName;
@Json(name = "email")
private final String email;
@Json(name = "phone")
private final String phone;

private ProfileHint(
String firstName,
String lastName,
String email,
String phone) {
this.firstName = firstName;
this.lastName = lastName;
this.email = email;
this.phone = phone;
}
}

0 comments on commit 066a1de

Please sign in to comment.