forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding missing API upsert with PartitionKey (Azure#13497)
* partitionKey support for upsert * partitionKey support for upsert * Fixed potential null pointer issue Co-authored-by: Kushagra Thapar <[email protected]>
- Loading branch information
1 parent
7d12ed3
commit 089078c
Showing
4 changed files
with
137 additions
and
60 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
90 changes: 90 additions & 0 deletions
90
sdk/cosmos/azure-cosmos/src/test/java/com/azure/cosmos/TestObject.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.cosmos; | ||
|
||
import com.azure.cosmos.implementation.guava25.collect.ImmutableList; | ||
import com.azure.cosmos.rx.DocumentCrudTest; | ||
|
||
import java.util.List; | ||
import java.util.Objects; | ||
import java.util.UUID; | ||
|
||
public class TestObject { | ||
private String id; | ||
private String mypk; | ||
private List<List<Integer>> sgmts; | ||
private String stringProp; | ||
|
||
public TestObject() { | ||
} | ||
|
||
public TestObject(String id, String mypk, List<List<Integer>> sgmts, String stringProp) { | ||
this.id = id; | ||
this.mypk = mypk; | ||
this.sgmts = sgmts; | ||
this.stringProp = stringProp; | ||
} | ||
|
||
public static TestObject create() { | ||
return new TestObject(UUID.randomUUID().toString(), UUID.randomUUID().toString(), ImmutableList.of(ImmutableList.of(5)), UUID.randomUUID().toString()); | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getMypk() { | ||
return mypk; | ||
} | ||
|
||
public void setMypk(String mypk) { | ||
this.mypk = mypk; | ||
} | ||
|
||
public List<List<Integer>> getSgmts() { | ||
return sgmts; | ||
} | ||
|
||
public void setSgmts(List<List<Integer>> sgmts) { | ||
this.sgmts = sgmts; | ||
} | ||
|
||
/** | ||
* Getter for property 'stringProp'. | ||
* | ||
* @return Value for property 'stringProp'. | ||
*/ | ||
public String getStringProp() { | ||
return stringProp; | ||
} | ||
|
||
/** | ||
* Setter for property 'stringProp'. | ||
* | ||
* @param stringProp Value to set for property 'stringProp'. | ||
*/ | ||
public void setStringProp(String stringProp) { | ||
this.stringProp = stringProp; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
TestObject that = (TestObject) o; | ||
return Objects.equals(id, that.id) && | ||
Objects.equals(mypk, that.mypk) && | ||
Objects.equals(sgmts, that.sgmts) && | ||
Objects.equals(stringProp, that.stringProp); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Objects.hash(id, mypk, sgmts, stringProp); | ||
} | ||
} |
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