Mixin UploadStrategyMixin

This mixin provides additional properties and methods which you can invoke on an instance of UploadStrategy.

Name Description
Methods
from Convert value to UploadStrategy
is Checks equality with string values

This mixin provides additional properties and methods for the native Java class UploadStrategy, whose native public methods are available for scripting, too. If a native method name is hidden by a property name in the mixin, then prefix the native name with $.

Functions

from:UploadStrategy

Checks whether a value can be converted into an UploadStrategy, converts and normalizes it, and returns the converted value. Throws an error, if value can't be converted.

Accepts one of the following values:
a UploadStrategy
just replies value
a string
One of the following strings:
  • individualobjects
  • chunked
  • singlerequest
Replies the matching enumeration value UploadStrategy
Throws an error, if value is null or undefined.

Parameters

Name Type Description
value string the value to normalize

Examples

var UploadStrategy = org.openstreetmap.josm.gui.io.UploadStrategy;
var strategy = UploadStrategy.from("individualobjects");

is:boolean

Replies true, if UploadStrategy, is equal to a specific enumeration value or to a string value.

Accepts one of the following values:
a UploadStrategy
replies true, if
a string
One of the following strings:
  • individualobjects
  • chunked
  • singlerequest
Replies true, if the value is a prefix of the preference value.

Parameters

Name Type Description
value string the value to check

Examples

var UploadStrategy = org.openstreetmap.josm.gui.io.UploadStrategy;
var strategy = UploadStrategy.INDIVIDUAL_OBJECTS_STRATEGY;
strategy.is("indiv");             // true
strategy.is("individualobjects"); // true
strategy.is("chunked");           // false