mirror of
https://github.com/apple/pkl.git
synced 2026-01-11 22:30:54 +01:00
Rename Config.from to Config.fromPklBinary (#1275)
This commit is contained in:
@@ -78,7 +78,7 @@ public interface Config {
|
||||
*
|
||||
* @return the encoded config
|
||||
*/
|
||||
static Config from(byte[] bytes, ValueMapper mapper) {
|
||||
static Config fromPklBinary(byte[] bytes, ValueMapper mapper) {
|
||||
return makeConfig(PklBinaryDecoder.decode(bytes), mapper);
|
||||
}
|
||||
|
||||
@@ -87,8 +87,8 @@ public interface Config {
|
||||
*
|
||||
* @return the encoded config
|
||||
*/
|
||||
static Config from(byte[] bytes) {
|
||||
return from(bytes, ValueMapper.preconfigured());
|
||||
static Config fromPklBinary(byte[] bytes) {
|
||||
return fromPklBinary(bytes, ValueMapper.preconfigured());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public interface Config {
|
||||
*
|
||||
* @return the encoded config
|
||||
*/
|
||||
static Config from(InputStream inputStream, ValueMapper mapper) {
|
||||
static Config fromPklBinary(InputStream inputStream, ValueMapper mapper) {
|
||||
return makeConfig(PklBinaryDecoder.decode(inputStream), mapper);
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ public interface Config {
|
||||
*
|
||||
* @return the encoded config
|
||||
*/
|
||||
static Config from(InputStream inputStream) {
|
||||
return from(inputStream, ValueMapper.preconfigured());
|
||||
static Config fromPklBinary(InputStream inputStream) {
|
||||
return fromPklBinary(inputStream, ValueMapper.preconfigured());
|
||||
}
|
||||
|
||||
private static Config makeConfig(Object decoded, ValueMapper mapper) {
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ConfigPklBinaryDecoderTest extends AbstractConfigTest {
|
||||
@Override
|
||||
protected Config getPigeonConfig() {
|
||||
// pigeon { age = 30; friends = List("john", "mary"); address { street = "Fuzzy St." } }
|
||||
return Config.from(
|
||||
return Config.fromPklBinary(
|
||||
Base64.getDecoder()
|
||||
.decode(
|
||||
"lAGkdGVzdNklZmlsZTovLy9Vc2Vycy9qYmFzY2gvc3JjL3BrbC90ZXN0LnBrbJGTEKZwaWdlb26UAadEeW5hbWljqHBrbDpiYXNlk5MQo2FnZR6TEKdmcmllbmRzkgSSpGpvaG6kbWFyeZMQp2FkZHJlc3OUAadEeW5hbWljqHBrbDpiYXNlkZMQpnN0cmVldKlGdXp6eSBTdC4="));
|
||||
@@ -32,7 +32,7 @@ public class ConfigPklBinaryDecoderTest extends AbstractConfigTest {
|
||||
@Override
|
||||
protected Config getPigeonModuleConfig() {
|
||||
// age = 30; friends = List("john", "mary"); address { street = "Fuzzy St." }
|
||||
return Config.from(
|
||||
return Config.fromPklBinary(
|
||||
Base64.getDecoder()
|
||||
.decode(
|
||||
"lAGlc3RkaW6xZmlsZTovLy9kZXYvc3RkaW6TkxCjYWdlHpMQp2ZyaWVuZHOSBJKkam9obqRtYXJ5kxCnYWRkcmVzc5QBp0R5bmFtaWOocGtsOmJhc2WRkxCmc3RyZWV0qUZ1enp5IFN0Lg=="));
|
||||
@@ -41,7 +41,7 @@ public class ConfigPklBinaryDecoderTest extends AbstractConfigTest {
|
||||
@Override
|
||||
protected Config getPairConfig() {
|
||||
// x { first = "file/path"; second = 42 }
|
||||
return Config.from(
|
||||
return Config.fromPklBinary(
|
||||
Base64.getDecoder()
|
||||
.decode(
|
||||
"lAGlc3RkaW6xZmlsZTovLy9kZXYvc3RkaW6RkxCheJQBp0R5bmFtaWOocGtsOmJhc2WSkxClZmlyc3SpZmlsZS9wYXRokxCmc2Vjb25kKg=="));
|
||||
@@ -50,7 +50,7 @@ public class ConfigPklBinaryDecoderTest extends AbstractConfigTest {
|
||||
@Override
|
||||
protected Config getMapConfig() {
|
||||
// x = Map("one", 1, "two", 2)
|
||||
return Config.from(
|
||||
return Config.fromPklBinary(
|
||||
Base64.getDecoder().decode("lAGlc3RkaW6xZmlsZTovLy9kZXYvc3RkaW6RkxCheJICgqNvbmUBo3R3bwI="));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user