com.backendless.hive.ScanResultFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-sdk-common Show documentation
Show all versions of java-sdk-common Show documentation
Provides access to Backendless API
The newest version!
package com.backendless.hive;
import weborb.types.IAdaptingType;
import weborb.util.IArgumentObjectFactory;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
public class ScanResultFactory implements IArgumentObjectFactory
{
@Override
public Object createObject( IAdaptingType iAdaptingType )
{
Map properties = (Map) iAdaptingType.defaultAdapt();
Object[] keys = (Object[]) properties.get( "keys" );
String cursor = (String) properties.get( "cursor" );
return new ScanResult( (List)Arrays.asList( keys ), cursor );
}
@Override
public boolean canAdapt( IAdaptingType iAdaptingType, Type type )
{
if( type instanceof Class )
{
return ((Class) (type)).getName().equals( ScanResult.class.getName() );
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy