简体   繁体   中英

Java or Kotlin Alternative to JS ParseObject.extend

I'm wanting to port a JavaScript code to Kotlin or Java while using the Android Parse library, but the Java Parse library doesn't have the function " ParseObject.extend() " because what "extend" does in JavaScript cannot be done in the Java world as far as I could understand. The question is now what would the alternative be, how can I port following code to Java or Kotlin ?:

const MyAddress = ParseObject.extend('_MyAddress');
const query = new ParseQuery(MyAddress);
const myAddressRecord = query.get(myAddress);

What I did was following:

val MyAddress = ParseObject.create("_MyAddress")
val query = ParseQuery(MyAddress.javaClass)
val myAddressRecord = query.get(myAddress)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM