idx int64 0 41.2k | question stringlengths 83 4.15k | target stringlengths 5 715 |
|---|---|---|
23,300 | public ReferrerList getCollectionReferrers ( Date date , String domain , String collectionId , int perPage , int page ) throws FlickrException { return getReferrers ( METHOD_GET_COLLECTION_REFERRERS , domain , "collection_id" , collectionId , date , perPage , page ) ; } | Get a list of referrers from a given domain to a collection . |
23,301 | public Stats getCollectionStats ( String collectionId , Date date ) throws FlickrException { return getStats ( METHOD_GET_COLLECTION_STATS , "collection_id" , collectionId , date ) ; } | Get the number of views comments and favorites on a collection for a given date . |
23,302 | public DomainList getPhotoDomains ( Date date , String photoId , int perPage , int page ) throws FlickrException { return getDomains ( METHOD_GET_PHOTO_DOMAINS , "photo_id" , photoId , date , perPage , page ) ; } | Get a list of referring domains for a photo . |
23,303 | public ReferrerList getPhotoReferrers ( Date date , String domain , String photoId , int perPage , int page ) throws FlickrException { return getReferrers ( METHOD_GET_PHOTO_REFERRERS , domain , "photo_id" , photoId , date , perPage , page ) ; } | Get a list of referrers from a given domain to a photo . |
23,304 | public Stats getPhotoStats ( String photoId , Date date ) throws FlickrException { return getStats ( METHOD_GET_PHOTO_STATS , "photo_id" , photoId , date ) ; } | Get the number of views comments and favorites on a photo for a given date . |
23,305 | public DomainList getPhotosetDomains ( Date date , String photosetId , int perPage , int page ) throws FlickrException { return getDomains ( METHOD_GET_PHOTOSET_DOMAINS , "photoset_id" , photosetId , date , perPage , page ) ; } | Get a list of referring domains for a photoset . |
23,306 | public ReferrerList getPhotosetReferrers ( Date date , String domain , String photosetId , int perPage , int page ) throws FlickrException { return getReferrers ( METHOD_GET_PHOTOSET_REFERRERS , domain , "photoset_id" , photosetId , date , perPage , page ) ; } | Get a list of referrers from a given domain to a photoset . |
23,307 | public Stats getPhotosetStats ( String photosetId , Date date ) throws FlickrException { return getStats ( METHOD_GET_PHOTOSET_STATS , "photoset_id" , photosetId , date ) ; } | Get the number of views comments and favorites on a photoset for a given date . |
23,308 | public DomainList getPhotostreamDomains ( Date date , int perPage , int page ) throws FlickrException { return getDomains ( METHOD_GET_PHOTOSTREAM_DOMAINS , null , null , date , perPage , page ) ; } | Get a list of referring domains for a photostream . |
23,309 | public ReferrerList getPhotostreamReferrers ( Date date , String domain , int perPage , int page ) throws FlickrException { return getReferrers ( METHOD_GET_PHOTOSTREAM_REFERRERS , domain , null , null , date , perPage , page ) ; } | Get a list of referrers from a given domain to a user s photostream . |
23,310 | public Stats getPhotostreamStats ( Date date ) throws FlickrException { return getStats ( METHOD_GET_PHOTOSTREAM_STATS , null , null , date ) ; } | Get the number of views comments and favorites on a photostream for a given date . |
23,311 | public PhotoList < Photo > getPopularPhotos ( Date date , StatsSort sort , int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_POPULAR_PHOTOS ) ; if ( date != null ) { parameters . put ( "date" , String . v... | List the photos with the most views comments or favorites . |
23,312 | public synchronized GeoInterface getGeoInterface ( ) { if ( geoInterface == null ) { geoInterface = new GeoInterface ( apiKey , sharedSecret , transport ) ; } return geoInterface ; } | Get the geo interface . |
23,313 | public void addTags ( String photoId , String [ ] tags ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_ADD_TAGS ) ; parameters . put ( "photo_id" , photoId ) ; parameters . put ( "tags" , StringUtilities . join ( tags , " " , tru... | Add tags to a photo . |
23,314 | public void delete ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_DELETE ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transport . post ( transport . getPath ( ) , parameters , apiKey , sha... | Delete a photo from flickr . |
23,315 | public PhotoAllContext getAllContexts ( String photoId ) throws FlickrException { PhotoSetList < PhotoSet > setList = new PhotoSetList < PhotoSet > ( ) ; PoolList < Pool > poolList = new PoolList < Pool > ( ) ; PhotoAllContext allContext = new PhotoAllContext ( ) ; Map < String , Object > parameters = new HashMap < Str... | Returns all visble sets and pools the photo belongs to . |
23,316 | public PhotoList < Photo > getContactsPhotos ( int count , boolean justFriends , boolean singlePhoto , boolean includeSelf ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD... | Get photos from the user s contacts . |
23,317 | public PhotoList < Photo > getContactsPublicPhotos ( String userId , int count , boolean justFriends , boolean singlePhoto , boolean includeSelf ) throws FlickrException { return getContactsPublicPhotos ( userId , Extras . MIN_EXTRAS , count , justFriends , singlePhoto , includeSelf ) ; } | Get public photos from the user s contacts . |
23,318 | public PhotoContext getContext ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_CONTEXT ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transport . get ( transport . getPath ( ) , parameter... | Get the context for the specified photo . |
23,319 | public Collection < Photocount > getCounts ( Date [ ] dates , Date [ ] takenDates ) throws FlickrException { List < Photocount > photocounts = new ArrayList < Photocount > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_COUNTS ) ; if ( dates == n... | Gets a collection of photo counts for the given date ranges for the calling user . |
23,320 | public Collection < Exif > getExif ( String photoId , String secret ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_EXIF ) ; parameters . put ( "photo_id" , photoId ) ; if ( secret != null ) { parameters . put ( "secret" , se... | Get the Exif data for the photo . |
23,321 | public Collection < User > getFavorites ( String photoId , int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_FAVORITES ) ; parameters . put ( "photo_id" , photoId ) ; if ( perPage > 0 ) { parameters . put... | Returns the list of people who have favorited a given photo . |
23,322 | public Photo getInfo ( String photoId , String secret ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INFO ) ; parameters . put ( "photo_id" , photoId ) ; if ( secret != null ) { parameters . put ( "secret" , secret ) ; } Res... | Get all info for the specified photo . |
23,323 | public PhotoList < Photo > getNotInSet ( int perPage , int page ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , PhotosInterface . METHOD_GET_NOT_IN_SET ) ; RequestContext reques... | Return a collection of Photo objects not in part of any sets . |
23,324 | public Permissions getPerms ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PERMS ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transport . get ( transport . getPath ( ) , parameters , a... | Get the permission information for the specified photo . |
23,325 | public PhotoList < Photo > getRecent ( Set < String > extras , int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_RECENT ) ; if ( extras != null && ! extras . isEmpty ( ) ) { parameters . put ( Extras . KE... | Get a collection of recent photos . |
23,326 | public Collection < Size > getSizes ( String photoId , boolean sign ) throws FlickrException { SizeList < Size > sizes = new SizeList < Size > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_SIZES ) ; parameters . put ( "photo_id" , photoId ) ; R... | Get the available sizes of a Photo . |
23,327 | public PhotoList < Photo > getUntagged ( int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_UNTAGGED ) ; if ( perPage > 0 ) { parameters . put ( "per_page" , Integer . toString ( perPage ) ) ; } if ( page ... | Get the collection of untagged photos . |
23,328 | public PhotoList < Photo > getWithGeoData ( Date minUploadDate , Date maxUploadDate , Date minTakenDate , Date maxTakenDate , int privacyFilter , String sort , Set < String > extras , int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters ... | Returns a list of your geo - tagged photos . |
23,329 | public void removeTag ( String tagId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_REMOVE_TAG ) ; parameters . put ( "tag_id" , tagId ) ; Response response = transport . post ( transport . getPath ( ) , parameters , apiKey , sh... | Remove a tag from a photo . |
23,330 | public PhotoList < Photo > search ( SearchParameters params , int perPage , int page ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SEARCH ) ; parameters . putAll ( para... | Search for photos which match the given search parameters . |
23,331 | public PhotoList < Photo > searchInterestingness ( SearchParameters params , int perPage , int page ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INTERESTINGNESS ) ... | Search for interesting photos using the Flickr Interestingness algorithm . |
23,332 | public void setContentType ( String photoId , String contentType ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SET_CONTENTTYPE ) ; parameters . put ( "photo_id" , photoId ) ; parameters . put ( "content_type" , contentType ) ; ... | Set the content type of a photo . |
23,333 | public void setDates ( String photoId , Date datePosted , Date dateTaken , String dateTakenGranularity ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SET_DATES ) ; parameters . put ( "photo_id" , photoId ) ; if ( datePosted != n... | Set the dates for the specified photo . |
23,334 | public void setMeta ( String photoId , String title , String description ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SET_META ) ; parameters . put ( "photo_id" , photoId ) ; parameters . put ( "title" , title ) ; parameters .... | Set the meta data for the photo . |
23,335 | public void setPerms ( String photoId , Permissions permissions ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SET_PERMS ) ; parameters . put ( "photo_id" , photoId ) ; parameters . put ( "is_public" , permissions . isPublicFlag... | Set the permissions for the photo . |
23,336 | public List < Ticket > checkTickets ( Set < String > tickets ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_CHECK_TICKETS ) ; StringBuffer sb = new StringBuffer ( ) ; Iterator < String > it = tickets . iterator ( ) ; while ( it ... | Checks the status of one or more asynchronous photo upload tickets . This method does not require authentication . |
23,337 | public void setProxy ( String proxyHost , int proxyPort ) { System . setProperty ( "http.proxySet" , "true" ) ; System . setProperty ( "http.proxyHost" , proxyHost ) ; System . setProperty ( "http.proxyPort" , "" + proxyPort ) ; System . setProperty ( "https.proxyHost" , proxyHost ) ; System . setProperty ( "https.prox... | Set a proxy for REST - requests . |
23,338 | public void setProxy ( String proxyHost , int proxyPort , String username , String password ) { setProxy ( proxyHost , proxyPort ) ; proxyAuth = true ; proxyUser = username ; proxyPassword = password ; } | Set a proxy with authentication for REST - requests . |
23,339 | public com . flickr4java . flickr . Response get ( String path , Map < String , Object > parameters , String apiKey , String sharedSecret ) throws FlickrException { OAuthRequest request = new OAuthRequest ( Verb . GET , buildUrl ( path ) ) ; for ( Map . Entry < String , Object > entry : parameters . entrySet ( ) ) { re... | Invoke an HTTP GET request on a remote host . You must close the InputStream after you are done with . |
23,340 | public String addComment ( String photosetId , String commentText ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_ADD_COMMENT ) ; parameters . put ( "photoset_id" , photosetId ) ; parameters . put ( "comment_text" , commentText )... | Add a comment to a photoset . This method requires authentication with write permission . |
23,341 | public static String convertToFileSystemChar ( String name ) { String erg = "" ; Matcher m = Pattern . compile ( "[a-z0-9 _#&@\\[\\(\\)\\]\\-\\.]" , Pattern . CASE_INSENSITIVE ) . matcher ( name ) ; while ( m . find ( ) ) { erg += name . substring ( m . start ( ) , m . end ( ) ) ; } if ( erg . length ( ) > 200 ) { erg ... | convert filename to clean filename |
23,342 | public GeoPermissions getPerms ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PERMS ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transport . get ( transport . getPath ( ) , parameters ... | Get permissions for who may view geo data for a photo . |
23,343 | public void setPerms ( String photoId , GeoPermissions perms ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SET_PERMS ) ; parameters . put ( "photo_id" , photoId ) ; parameters . put ( "is_public" , perms . isPublic ( ) ? "1" : ... | Set the permission for who may view the geo data associated with a photo . |
23,344 | public PhotoList < Photo > photosForLocation ( GeoData location , Set < String > extras , int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; parameters . put ( "method" , METHOD_PHOTOS_FO... | Return a list of photos for a user at a specific latitude longitude and accuracy . |
23,345 | private Collection parseCollection ( Element collectionElement ) { Collection collection = new Collection ( ) ; collection . setId ( collectionElement . getAttribute ( "id" ) ) ; collection . setServer ( collectionElement . getAttribute ( "server" ) ) ; collection . setSecret ( collectionElement . getAttribute ( "secre... | Parse the XML for a collection as returned by getInfo call . |
23,346 | private Collection parseTreeCollection ( Element collectionElement ) { Collection collection = new Collection ( ) ; parseCommonFields ( collectionElement , collection ) ; collection . setTitle ( collectionElement . getAttribute ( "title" ) ) ; collection . setDescription ( collectionElement . getAttribute ( "descriptio... | Parse the XML for a collection as returned by getTree call . |
23,347 | public static String getValue ( Element element ) { if ( element != null ) { Node dataNode = element . getFirstChild ( ) ; if ( dataNode != null ) { return ( ( Text ) dataNode ) . getData ( ) ; } } return null ; } | Get the text value for the specified element . If the element is null or the element s body is empty then this method will return null . |
23,348 | public static Element getChild ( Element element , String name ) { return ( Element ) element . getElementsByTagName ( name ) . item ( 0 ) ; } | Get the first child element with the given name . |
23,349 | public static String getChildValue ( Element element , String name ) { return getValue ( getChild ( element , name ) ) ; } | Get the value of the fist child element with the given name . |
23,350 | public User findByEmail ( String email ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_FIND_BY_EMAIL ) ; parameters . put ( "find_email" , email ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters... | Find the user by their email address . |
23,351 | public Collection < Group > getPublicGroups ( String userId ) throws FlickrException { List < Group > groups = new ArrayList < Group > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PUBLIC_GROUPS ) ; parameters . put ( "user_id" , userId ) ; Res... | Get a collection of public groups for the user . |
23,352 | public PhotoList < Photo > getPublicPhotos ( String userId , Set < String > extras , int perPage , int page ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PUBLIC_PHO... | Get a collection of public photos for the specified user ID . |
23,353 | public User getUploadStatus ( ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_UPLOAD_STATUS ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isEr... | Get upload status for the currently authenticated user . |
23,354 | public void add ( String photoId , String userId , Rectangle bounds ) throws FlickrException { com . flickr4java . flickr . photos . people . PeopleInterface pi = new com . flickr4java . flickr . photos . people . PeopleInterface ( apiKey , sharedSecret , transportAPI ) ; pi . add ( photoId , userId , bounds ) ; } | Add the given person to the photo . Optionally send in co - ordinates |
23,355 | public PersonTagList < PersonTag > getList ( String photoId ) throws FlickrException { com . flickr4java . flickr . photos . people . PeopleInterface pi = new com . flickr4java . flickr . photos . people . PeopleInterface ( apiKey , sharedSecret , transportAPI ) ; return pi . getList ( photoId ) ; } | Get a list of people in a given photo . |
23,356 | public User getLimits ( ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIMITS ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { t... | Get s the user s current upload limits User object only contains user_id |
23,357 | public List < Gallery > getList ( String userId , int perPage , int page ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST ) ; parameters . put ( "user_id" , userId ) ; if ( perPage > 0 ) { parameters . put ( "per_page" , ... | Return the list of galleries created by a user . Sorted from newest to oldest . |
23,358 | public Note add ( String photoId , Note note ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_ADD ) ; parameters . put ( "photo_id" , photoId ) ; Rectangle bounds = note . getBounds ( ) ; if ( bounds != null ) { parameters . put (... | Add a note to a photo . The Note object bounds and text must be specified . |
23,359 | public void edit ( Note note ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_EDIT ) ; parameters . put ( "note_id" , note . getId ( ) ) ; Rectangle bounds = note . getBounds ( ) ; if ( bounds != null ) { parameters . put ( "note_... | Update a note . |
23,360 | public Collection < License > getInfo ( ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_INFO ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isE... | Fetches a list of available photo licenses for Flickr . |
23,361 | public void setLicense ( String photoId , int licenseId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_SET_LICENSE ) ; parameters . put ( "photo_id" , photoId ) ; parameters . put ( "license_id" , Integer . toString ( licenseId ... | Sets the license for a photo . |
23,362 | public PhotoList < Photo > getClusterPhotos ( String tag , String clusterId ) throws FlickrException { PhotoList < Photo > photos = new PhotoList < Photo > ( ) ; Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_CLUSTER_PHOTOS ) ; parameters . put ( "tag... | Returns the first 24 photos for a given tag cluster . |
23,363 | public Photo getListPhoto ( String photoId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST_PHOTO ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , param... | Get a list of tags for the specified photo . |
23,364 | public Collection < Tag > getListUser ( String userId ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_LIST_USER ) ; parameters . put ( "user_id" , userId ) ; Response response = transportAPI . get ( transportAPI . getPath ( )... | Get a collection of tags used by the specified user . |
23,365 | public RelatedTagsList getRelated ( String tag ) throws FlickrException { Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_RELATED ) ; parameters . put ( "tag" , tag ) ; Response response = transportAPI . get ( transportAPI . getPath ( ) , parameters , ... | Get the related tags . |
23,366 | public static void closeThrowSqlException ( Closeable closeable , String label ) throws SQLException { if ( closeable != null ) { try { closeable . close ( ) ; } catch ( IOException e ) { throw SqlExceptionUtil . create ( "could not close " + label , e ) ; } } } | Close it and ignore any exceptions . |
23,367 | public static Logger getLogger ( String className ) { if ( logType == null ) { logType = findLogType ( ) ; } return new Logger ( logType . createLog ( className ) ) ; } | Return a logger associated with a particular class name . |
23,368 | public static String getSimpleClassName ( String className ) { String [ ] parts = className . split ( "\\." ) ; if ( parts . length <= 1 ) { return className ; } else { return parts [ parts . length - 1 ] ; } } | Return the single class name from a class - name string . |
23,369 | private static LogType findLogType ( ) { String logTypeString = System . getProperty ( LOG_TYPE_SYSTEM_PROPERTY ) ; if ( logTypeString != null ) { try { return LogType . valueOf ( logTypeString ) ; } catch ( IllegalArgumentException e ) { Log log = new LocalLog ( LoggerFactory . class . getName ( ) ) ; log . log ( Leve... | Return the most appropriate log type . This should _never_ return null . |
23,370 | public void trace ( String msg ) { logIfEnabled ( Level . TRACE , null , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , null ) ; } | Log a trace message . |
23,371 | public void trace ( Throwable throwable , String msg , Object [ ] argArray ) { logIfEnabled ( Level . TRACE , throwable , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , argArray ) ; } | Log a trace message with a throwable . |
23,372 | public void info ( Throwable throwable , String msg , Object [ ] argArray ) { logIfEnabled ( Level . INFO , throwable , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , argArray ) ; } | Log a info message with a throwable . |
23,373 | public void warn ( Throwable throwable , String msg , Object [ ] argArray ) { logIfEnabled ( Level . WARNING , throwable , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , argArray ) ; } | Log a warning message with a throwable . |
23,374 | public void fatal ( String msg ) { logIfEnabled ( Level . FATAL , null , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , null ) ; } | Log a fatal message . |
23,375 | public void fatal ( Throwable throwable , String msg , Object [ ] argArray ) { logIfEnabled ( Level . FATAL , throwable , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , argArray ) ; } | Log a fatal message with a throwable . |
23,376 | public void log ( Level level , String msg ) { logIfEnabled ( level , null , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , null ) ; } | Log a message at the provided level . |
23,377 | public void log ( Level level , Throwable throwable , String msg , Object [ ] argArray ) { logIfEnabled ( level , throwable , msg , UNKNOWN_ARG , UNKNOWN_ARG , UNKNOWN_ARG , argArray ) ; } | Log a message with a throwable at the provided level . |
23,378 | public synchronized static < D extends Dao < T , ? > , T > D lookupDao ( ConnectionSource connectionSource , Class < T > clazz ) { if ( connectionSource == null ) { throw new IllegalArgumentException ( "connectionSource argument cannot be null" ) ; } ClassConnectionSource key = new ClassConnectionSource ( connectionSou... | Helper method to lookup a DAO if it has already been associated with the class . Otherwise this returns null . |
23,379 | public synchronized static < D extends Dao < T , ? > , T > D lookupDao ( ConnectionSource connectionSource , DatabaseTableConfig < T > tableConfig ) { if ( connectionSource == null ) { throw new IllegalArgumentException ( "connectionSource argument cannot be null" ) ; } TableConfigConnectionSource key = new TableConfig... | Helper method to lookup a DAO if it has already been associated with the table - config . Otherwise this returns null . |
23,380 | public static synchronized void registerDao ( ConnectionSource connectionSource , Dao < ? , ? > dao ) { if ( connectionSource == null ) { throw new IllegalArgumentException ( "connectionSource argument cannot be null" ) ; } addDaoToClassMap ( new ClassConnectionSource ( connectionSource , dao . getDataClass ( ) ) , dao... | Register the DAO with the cache . This will allow folks to build a DAO externally and then register so it can be used internally as necessary . |
23,381 | public static synchronized void unregisterDao ( ConnectionSource connectionSource , Dao < ? , ? > dao ) { if ( connectionSource == null ) { throw new IllegalArgumentException ( "connectionSource argument cannot be null" ) ; } removeDaoToClassMap ( new ClassConnectionSource ( connectionSource , dao . getDataClass ( ) ) ... | Remove a DAO from the cache . This is necessary if we ve registered it already but it throws an exception during configuration . |
23,382 | public static synchronized void clearDaoCache ( ) { if ( classMap != null ) { classMap . clear ( ) ; classMap = null ; } if ( tableConfigMap != null ) { tableConfigMap . clear ( ) ; tableConfigMap = null ; } } | Clear out our DAO caches . |
23,383 | public static synchronized void addCachedDatabaseConfigs ( Collection < DatabaseTableConfig < ? > > configs ) { Map < Class < ? > , DatabaseTableConfig < ? > > newMap ; if ( configMap == null ) { newMap = new HashMap < Class < ? > , DatabaseTableConfig < ? > > ( ) ; } else { newMap = new HashMap < Class < ? > , Databas... | This adds database table configurations to the internal cache which can be used to speed up DAO construction . This is especially true of Android and other mobile platforms . |
23,384 | private static < D , T > D createDaoFromConfig ( ConnectionSource connectionSource , Class < T > clazz ) throws SQLException { if ( configMap == null ) { return null ; } @ SuppressWarnings ( "unchecked" ) DatabaseTableConfig < T > config = ( DatabaseTableConfig < T > ) configMap . get ( clazz ) ; if ( config == null ) ... | Creates the DAO if we have config information cached and caches the DAO . |
23,385 | public < T > void cleanNullReferences ( Class < T > clazz ) { Map < Object , Reference < Object > > objectMap = getMapForClass ( clazz ) ; if ( objectMap != null ) { cleanMap ( objectMap ) ; } } | Run through the map and remove any references that have been null d out by the GC . |
23,386 | public < T > void cleanNullReferencesAll ( ) { for ( Map < Object , Reference < Object > > objectMap : classMaps . values ( ) ) { cleanMap ( objectMap ) ; } } | Run through all maps and remove any references that have been null d out by the GC . |
23,387 | public boolean addAll ( Collection < ? extends T > collection ) { boolean changed = false ; for ( T data : collection ) { try { if ( addElement ( data ) ) { changed = true ; } } catch ( SQLException e ) { throw new IllegalStateException ( "Could not create data elements in dao" , e ) ; } } return changed ; } | Add the collection of elements to this collection . This will also them to the associated database table . |
23,388 | public boolean retainAll ( Collection < ? > collection ) { if ( dao == null ) { return false ; } boolean changed = false ; CloseableIterator < T > iterator = closeableIterator ( ) ; try { while ( iterator . hasNext ( ) ) { T data = iterator . next ( ) ; if ( ! collection . contains ( data ) ) { iterator . remove ( ) ; ... | Uses the iterator to run through the dao and retain only the items that are in the passed in collection . This will remove the items from the associated database table as well . |
23,389 | public void clear ( ) { if ( dao == null ) { return ; } CloseableIterator < T > iterator = closeableIterator ( ) ; try { while ( iterator . hasNext ( ) ) { iterator . next ( ) ; iterator . remove ( ) ; } } finally { IOUtils . closeQuietly ( iterator ) ; } } | Clears the collection and uses the iterator to run through the dao and delete all of the items in the collection from the associated database table . This is different from removing all of the elements in the table since this iterator is across just one item s foreign objects . |
23,390 | public Where < T , ID > and ( ) { ManyClause clause = new ManyClause ( pop ( "AND" ) , ManyClause . AND_OPERATION ) ; push ( clause ) ; addNeedsFuture ( clause ) ; return this ; } | AND operation which takes the previous clause and the next clause and AND s them together . |
23,391 | public Where < T , ID > between ( String columnName , Object low , Object high ) throws SQLException { addClause ( new Between ( columnName , findColumnFieldType ( columnName ) , low , high ) ) ; return this ; } | Add a BETWEEN clause so the column must be between the low and high parameters . |
23,392 | public Where < T , ID > eq ( String columnName , Object value ) throws SQLException { addClause ( new SimpleComparison ( columnName , findColumnFieldType ( columnName ) , value , SimpleComparison . EQUAL_TO_OPERATION ) ) ; return this ; } | Add a = clause so the column must be equal to the value . |
23,393 | public Where < T , ID > ge ( String columnName , Object value ) throws SQLException { addClause ( new SimpleComparison ( columnName , findColumnFieldType ( columnName ) , value , SimpleComparison . GREATER_THAN_EQUAL_TO_OPERATION ) ) ; return this ; } | Add a > ; = clause so the column must be greater - than or equals - to the value . |
23,394 | public Where < T , ID > gt ( String columnName , Object value ) throws SQLException { addClause ( new SimpleComparison ( columnName , findColumnFieldType ( columnName ) , value , SimpleComparison . GREATER_THAN_OPERATION ) ) ; return this ; } | Add a > ; clause so the column must be greater - than the value . |
23,395 | public Where < T , ID > in ( String columnName , Iterable < ? > objects ) throws SQLException { addClause ( new In ( columnName , findColumnFieldType ( columnName ) , objects , true ) ) ; return this ; } | Add a IN clause so the column must be equal - to one of the objects from the list passed in . |
23,396 | public Where < T , ID > in ( String columnName , Object ... objects ) throws SQLException { return in ( true , columnName , objects ) ; } | Add a IN clause so the column must be equal - to one of the objects passed in . |
23,397 | public Where < T , ID > exists ( QueryBuilder < ? , ? > subQueryBuilder ) { subQueryBuilder . enableInnerQuery ( ) ; addClause ( new Exists ( new InternalQueryBuilderWrapper ( subQueryBuilder ) ) ) ; return this ; } | Add a EXISTS clause with a sub - query inside of parenthesis . |
23,398 | public Where < T , ID > isNull ( String columnName ) throws SQLException { addClause ( new IsNull ( columnName , findColumnFieldType ( columnName ) ) ) ; return this ; } | Add a IS NULL clause so the column must be null . = NULL does not work . |
23,399 | public Where < T , ID > isNotNull ( String columnName ) throws SQLException { addClause ( new IsNotNull ( columnName , findColumnFieldType ( columnName ) ) ) ; return this ; } | Add a IS NOT NULL clause so the column must not be null . < ; > ; NULL does not work . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.