idx int64 0 165k | question stringlengths 73 4.15k | target stringlengths 5 918 | len_question int64 21 890 | len_target int64 3 255 |
|---|---|---|---|---|
42,500 | public IScope createSimpleFeatureCallScope ( EObject context , IFeatureScopeSession session , IResolvedTypes resolvedTypes ) { IScope root = IScope . NULLSCOPE ; if ( context instanceof XFeatureCall ) { XFeatureCall featureCall = ( XFeatureCall ) context ; if ( ! featureCall . isExplicitOperationCallOrBuilderSyntax ( )... | This method serves as an entry point for the content assist scoping for simple feature calls . | 306 | 18 |
42,501 | public IScope createFeatureCallScopeForReceiver ( final XExpression featureCall , final XExpression receiver , IFeatureScopeSession session , IResolvedTypes resolvedTypes ) { if ( receiver == null || receiver . eIsProxy ( ) ) return IScope . NULLSCOPE ; LightweightTypeReference receiverType = resolvedTypes . getActualT... | This method serves as an entry point for the content assist scoping for features . | 662 | 16 |
42,502 | protected IScope createDynamicExtensionsScope ( EObject featureCall , XExpression firstArgument , LightweightTypeReference firstArgumentType , boolean implicitArgument , IScope parent , IFeatureScopeSession session ) { return new DynamicExtensionsScope ( parent , session , firstArgument , firstArgumentType , implicitAr... | Create a scope that contains dynamic extension features which are features that are contributed by an instance of a type . | 87 | 21 |
42,503 | protected IScope createStaticExtensionsScope ( EObject featureCall , XExpression firstArgument , LightweightTypeReference firstArgumentType , boolean implicitArgument , IScope parent , IFeatureScopeSession session ) { return new StaticExtensionImportsScope ( parent , session , firstArgument , firstArgumentType , implic... | Create a scope that contains static extension features which are features that are contributed statically via an import . | 89 | 19 |
42,504 | protected IScope createNestedTypeLiteralScope ( EObject featureCall , LightweightTypeReference enclosingType , JvmDeclaredType rawEnclosingType , IScope parent , IFeatureScopeSession session ) { return new NestedTypeLiteralScope ( parent , session , asAbstractFeatureCall ( featureCall ) , enclosingType , rawEnclosingTy... | Create a scope that returns nested types . | 84 | 8 |
42,505 | protected IScope createStaticFeaturesScope ( EObject featureCall , IScope parent , IFeatureScopeSession session ) { return new StaticImportsScope ( parent , session , asAbstractFeatureCall ( featureCall ) ) ; } | Creates a scope for the statically imported features . | 48 | 10 |
42,506 | protected IScope createLocalVariableScope ( EObject featureCall , IScope parent , IFeatureScopeSession session , IResolvedTypes resolvedTypes ) { return new LocalVariableScope ( parent , session , asAbstractFeatureCall ( featureCall ) ) ; } | Creates a scope for the local variables that have been registered in the given session . | 54 | 17 |
42,507 | protected CompositeScope createCompositeScope ( EObject featureCall , IScope parent , IFeatureScopeSession session ) { return new CompositeScope ( parent , session , asAbstractFeatureCall ( featureCall ) ) ; } | Create a composite scope that returns description from multiple other scopes without applying shadowing semantics to then . | 46 | 20 |
42,508 | protected IScope createReceiverFeatureScope ( EObject featureCall , XExpression receiver , LightweightTypeReference receiverType , JvmIdentifiableElement receiverFeature , boolean implicitReceiver , boolean validStatic , TypeBucket receiverBucket , IScope parent , IFeatureScopeSession session ) { return new ReceiverFea... | Creates a scope that returns the features of a given receiver type . | 107 | 14 |
42,509 | protected void addIssue ( final JvmDeclaredType type , final String fileName ) { StringConcatenation _builder = new StringConcatenation ( ) ; _builder . append ( "The type " ) ; String _simpleName = type . getSimpleName ( ) ; _builder . append ( _simpleName ) ; _builder . append ( " is already defined" ) ; { if ( ( fil... | Marks a type as already defined . | 237 | 8 |
42,510 | protected void handleCollectionTypeNotAvailable ( XCollectionLiteral literal , ITypeComputationState state , Class < ? > clazz ) { for ( XExpression element : literal . getElements ( ) ) { state . withNonVoidExpectation ( ) . computeTypes ( element ) ; } state . acceptActualType ( state . getReferenceOwner ( ) . newUnk... | Process all children and assign an unknown type to the literal . | 97 | 12 |
42,511 | protected boolean matchesExpectation ( LightweightTypeReference elementType , LightweightTypeReference expectation ) { return expectation != null && expectation . isResolved ( ) && ! expectation . isWildcard ( ) && expectation . isAssignableFrom ( elementType ) ; } | Implements fall - back strategy . If the expected type of a collection literal does not match the actual type but the expected element types would match the actual element type the collection literal will be successfully typed according to the expectation . | 56 | 45 |
42,512 | protected LightweightTypeReference doNormalizeElementType ( LightweightTypeReference actual , LightweightTypeReference expected ) { if ( matchesExpectation ( actual , expected ) ) { return expected ; } return normalizeFunctionTypeReference ( actual ) ; } | If the expected type is not a wildcard it may supersede the actual element type . | 52 | 18 |
42,513 | protected List < LightweightTypeReference > computeCollectionTypeCandidates ( XCollectionLiteral literal , JvmGenericType collectionType , LightweightTypeReference elementTypeExpectation , ITypeComputationState state ) { List < XExpression > elements = literal . getElements ( ) ; if ( ! elements . isEmpty ( ) ) { List ... | Creates a list of collection type references from the element types of a collection literal . | 248 | 17 |
42,514 | @ Override protected List < XExpression > getArguments ( ) { List < XExpression > syntacticArguments = getSyntacticArguments ( ) ; XExpression firstArgument = getFirstArgument ( ) ; if ( firstArgument != null ) { return createArgumentList ( firstArgument , syntacticArguments ) ; } return syntacticArguments ; } | Returns the actual arguments of the expression . These do not include the receiver . | 83 | 15 |
42,515 | protected IScope createAnonymousClassConstructorScope ( final JvmGenericType anonymousType , EObject context , final IFeatureScopeSession session ) { // we don't care about the type scope since the type is well known here IVisibilityHelper protectedIsVisible = new IVisibilityHelper ( ) { @ Override public boolean isVis... | Custom languages that allow to infer anonymous classes may want to use this helper to access the constructors of those classes . | 628 | 23 |
42,516 | public String toJavaIdentifier ( final String text , final boolean uppercaseFirst ) { return GrammarAccessUtil . toJavaIdentifier ( text , Boolean . valueOf ( uppercaseFirst ) ) ; } | Converts an arbitary string to a valid Java identifier . The string is split up along the the characters that are not valid as Java identifier . The first character of each segments is made upper case which leads to a camel - case style . | 46 | 48 |
42,517 | public String gaRuleIdentifyer ( final AbstractRule rule ) { final String plainName = RuleNames . getRuleNames ( rule ) . getUniqueRuleName ( rule ) ; return this . toJavaIdentifier ( plainName , true ) ; } | Creates an identifier for a Rule which is a valid Java idetifier and unique within the Rule s grammar . | 52 | 23 |
42,518 | public String gaRuleAccessMethodName ( final AbstractRule rule ) { String _gaRuleIdentifyer = this . gaRuleIdentifyer ( rule ) ; String _plus = ( "get" + _gaRuleIdentifyer ) ; return ( _plus + "Rule" ) ; } | Returns the method name for accessing a rule via a GrammarAccess implementation . | 61 | 15 |
42,519 | public String gaRuleElementsMethodName ( final AbstractRule rule ) { String _gaRuleIdentifyer = this . gaRuleIdentifyer ( rule ) ; String _plus = ( "get" + _gaRuleIdentifyer ) ; return ( _plus + "Access" ) ; } | Returns the method name for accessing a rule s content via a ParseRuleAccess implementation . | 62 | 18 |
42,520 | public IScope createFeatureCallSerializationScope ( EObject context ) { if ( ! ( context instanceof XAbstractFeatureCall ) ) { return IScope . NULLSCOPE ; } XAbstractFeatureCall call = ( XAbstractFeatureCall ) context ; JvmIdentifiableElement feature = call . getFeature ( ) ; // this and super - logical container aware... | which is quite hard anyway ... | 236 | 6 |
42,521 | public void optimizeLineSection ( ) { /* Some debugging code for (int i = 0; i < lineData.size(); i++) { LineInfo li = (LineInfo)lineData.get(i); System.out.print(li.toString()); } */ //Incorporate each LineInfo into the previous LineInfo's //outputLineIncrement, if possible int i = 0 ; while ( i < lineData . size ( ) ... | Combines consecutive LineInfos wherever possible | 417 | 8 |
42,522 | public GeneratorConfig copy ( final GeneratorConfig other ) { this . generateExpressions = other . generateExpressions ; this . generateSyntheticSuppressWarnings = other . generateSyntheticSuppressWarnings ; this . generateGeneratedAnnotation = other . generateGeneratedAnnotation ; this . includeDateInGeneratedAnnotati... | Copy the values of the given generator configuration . | 113 | 9 |
42,523 | public static int compareFlags ( int left , int right ) { if ( left == right ) { return 0 ; } int leftSuccess = left & SUCCESS_OR_LAMBDA ; int rightSuccess = right & SUCCESS_OR_LAMBDA ; if ( leftSuccess != rightSuccess ) { if ( leftSuccess == 0 ) return 1 ; if ( rightSuccess == 0 ) return - 1 ; if ( leftSuccess < right... | Simple comparison of two flags . If both indicate compatibility the one with the better compatibility level wins . | 150 | 19 |
42,524 | public static boolean sanityCheck ( int flags ) { doCheck ( flags , ConformanceFlags . CHECKED | ConformanceFlags . UNCHECKED ) ; if ( ( flags & ConformanceFlags . UNCHECKED ) == 0 ) { doCheck ( flags , ConformanceFlags . CHECK_RESULTS ) ; } else if ( ( flags & ( ConformanceFlags . SEALED | ConformanceFlags . CHECK_RES... | Simple sanity check for the given flags . | 118 | 8 |
42,525 | @ Override protected Map < JvmTypeParameter , LightweightMergedBoundTypeArgument > getTypeParameterMapping ( ) { if ( typeParameterMapping == null ) { typeParameterMapping = initializeTypeParameterMapping ( ) ; } return typeParameterMapping ; } | Returns the mapping of type parameters to their bound arguments . | 59 | 11 |
42,526 | protected String getArgumentTypesAsString ( ) { if ( ! getArguments ( ) . isEmpty ( ) ) { StringBuilder b = new StringBuilder ( ) ; b . append ( "(" ) ; for ( int i = 0 ; i < getArguments ( ) . size ( ) ; ++ i ) { LightweightTypeReference actualType = getActualType ( getArguments ( ) . get ( i ) ) ; if ( actualType != ... | Returns the resolved string representation of the argument types . The simple names of the types are used . The string representation includes the parenthesis . | 170 | 27 |
42,527 | protected String getFeatureTypeParametersAsString ( boolean showBounds ) { List < JvmTypeParameter > typeParameters = getDeclaredTypeParameters ( ) ; if ( ! typeParameters . isEmpty ( ) ) { StringBuilder b = new StringBuilder ( ) ; b . append ( "<" ) ; for ( int i = 0 ; i < typeParameters . size ( ) ; ++ i ) { JvmTypeP... | Returns the unresolved string representation of the unresolved type parameters of the feature . The simple names of the type bounds are used . The string representation includes the angle brackets . | 177 | 32 |
42,528 | protected String getTypeArgumentsAsString ( List < ? extends LightweightTypeReference > typeArguments ) { if ( ! typeArguments . isEmpty ( ) ) { StringBuilder b = new StringBuilder ( ) ; b . append ( "<" ) ; for ( int i = 0 ; i < typeArguments . size ( ) ; ++ i ) { b . append ( typeArguments . get ( i ) . getHumanReada... | Returns the resolved string representation of the type arguments . The simple names of the types are used . The string representation includes the angle brackets . | 141 | 27 |
42,529 | @ Override public ILinkingCandidate getPreferredCandidate ( ILinkingCandidate other ) { if ( other instanceof AbstractPendingLinkingCandidate ) { AbstractPendingLinkingCandidate < ? > right = ( AbstractPendingLinkingCandidate < ? > ) other ; CandidateCompareResult candidateCompareResult = compareTo ( right ) ; switch (... | Returns the best candidate considering the this and the given other candidate . | 160 | 13 |
42,530 | public int getArityMismatch ( ) { JvmIdentifiableElement identifiable = getFeature ( ) ; if ( identifiable instanceof JvmExecutable ) { return getArityMismatch ( ( JvmExecutable ) identifiable , getArguments ( ) ) ; } else if ( getExpression ( ) instanceof XAssignment ) { return getArguments ( ) . size ( ) - 1 ; } else... | Returns the mismatch of actually given arguments and declared parameters . Receivers and staticness of the feature is taken into account too . The mismatch may either be negative or positive . | 102 | 34 |
42,531 | public < T extends Object > void forEach ( final ITreeAppendable appendable , final Iterable < T > elements , final Procedure1 < ? super LoopParams > loopInitializer , final Procedure1 < ? super T > procedure ) { boolean _isEmpty = IterableExtensions . isEmpty ( elements ) ; if ( _isEmpty ) { return ; } LoopParams _loo... | Iterates elements and execute the procedure . A prefix a separator and a suffix can be initialized with the loopInitializer lambda . | 247 | 26 |
42,532 | public < T extends Object > void forEachWithShortcut ( final ITreeAppendable appendable , final Iterable < T > elements , final Procedure1 < ? super T > procedure ) { int _size = IterableExtensions . size ( elements ) ; boolean _equals = ( _size == 1 ) ; if ( _equals ) { T _head = IterableExtensions . < T > head ( elem... | Uses curly braces and comma as delimiters . Doesn t use them for single valued iterables . | 205 | 21 |
42,533 | protected void processAsPropertyNames ( QualifiedName name , NameAcceptor acceptor ) { String nameAsPropertyName = tryGetAsPropertyName ( name . toString ( ) ) ; if ( nameAsPropertyName != null ) { if ( featureCall == null || featureCall instanceof XAssignment ) { String aliasedSetter = "set" + nameAsPropertyName ; acc... | Considers the given name to be a property name . If the concrete syntax of the processed feature matches a feature call or assignment a prefix is added to the name and that one is used as a variant that should be processed . | 199 | 45 |
42,534 | private boolean handleOverridesAndConflicts ( JvmOperation operation , Multimap < String , AbstractResolvedOperation > processedOperations ) { String simpleName = operation . getSimpleName ( ) ; if ( ! processedOperations . containsKey ( simpleName ) ) { return true ; } List < AbstractResolvedOperation > conflictingOpe... | When the inherited operations are computed for Java 8 we have to check for conflicting default interface method implementations . | 644 | 20 |
42,535 | public static UnboundTypeReference create ( ITypeExpectation expectation , XExpression expression , JvmTypeParameter typeParameter ) { return expectation . createUnboundTypeReference ( expression , typeParameter ) ; } | Create a new managed unbound type reference for the given type parameter which was first encountered for the given expression . | 44 | 22 |
42,536 | public void tryResolve ( boolean constraintsAreSignificant ) { if ( internalIsResolved ( ) ) return ; List < LightweightBoundTypeArgument > hints = getAllHints ( ) ; if ( ! hints . isEmpty ( ) && hasSignificantHints ( hints , constraintsAreSignificant ) ) { resolveWithHints ( hints ) ; } } | Try to resolve this reference iff there are hints available . May be invoked multiple times since it will simply returns if the reference is already resolved . The caller can decide whether type constraints are considered to be significant hints or not . | 77 | 45 |
42,537 | public boolean canResolveTo ( LightweightTypeReference reference ) { if ( internalIsResolved ( ) ) return reference . isAssignableFrom ( resolvedTo , new TypeConformanceComputationArgument ( false , true , true , true , false , false /* TODO do we need to support synonmys here? */ ) ) ; List < LightweightBoundTypeArgum... | Returns true if the existing hints would allow to resolve to the given reference . | 127 | 15 |
42,538 | public LightweightTypeReference resolve ( ) { if ( internalIsResolved ( ) ) return resolvedTo ; List < LightweightBoundTypeArgument > allHints = getAllHints ( ) ; if ( ! allHints . isEmpty ( ) && resolveWithHints ( allHints ) ) { LightweightTypeReference result = internalGetResolvedTo ( ) ; if ( result != null ) { retu... | Force this reference to be resolved . If not hints are available the reference is resolved to the constraints of the type parameters . | 104 | 24 |
42,539 | public ITreeAppendable compile ( XBlockExpression expr , ITreeAppendable b , LightweightTypeReference expectedReturnType ) { final boolean isPrimitiveVoidExpected = expectedReturnType . isPrimitiveVoid ( ) ; final boolean isPrimitiveVoid = isPrimitiveVoid ( expr ) ; final boolean earlyExit = isEarlyExit ( expr ) ; fina... | this one trims the outer block | 268 | 7 |
42,540 | @ Deprecated protected final boolean isVariableDeclarationRequired ( XExpression expr , ITreeAppendable b ) { return isVariableDeclarationRequired ( expr , b , true ) ; } | whether an expression needs to be declared in a statement If an expression has side effects this method must return true for it . | 40 | 24 |
42,541 | public int parseArgument ( Options opt , String [ ] args , int start ) throws BadCommandLineException , IOException { int consumed = 0 ; final String optionPrefix = "-" + getOptionName ( ) + "-" ; final int optionPrefixLength = optionPrefix . length ( ) ; final String arg = args [ start ] ; final int equalsPosition = a... | Parses the arguments and injects values into the beans via properties . | 211 | 15 |
42,542 | public static List < GrantedAuthority > buildAuthorities ( final List < CommonProfile > profiles ) { final List < GrantedAuthority > authorities = new ArrayList <> ( ) ; for ( final CommonProfile profile : profiles ) { final Set < String > roles = profile . getRoles ( ) ; for ( final String role : roles ) { authorities... | Build a list of authorities from a list of profiles . | 92 | 11 |
42,543 | public static void populateAuthentication ( final LinkedHashMap < String , CommonProfile > profiles ) { if ( profiles != null && profiles . size ( ) > 0 ) { final List < CommonProfile > listProfiles = ProfileHelper . flatIntoAProfileList ( profiles ) ; try { if ( IS_FULLY_AUTHENTICATED_AUTHORIZER . isAuthorized ( null ... | Populate the authenticated user profiles in the Spring Security context . | 201 | 12 |
42,544 | public CMAEditorInterface update ( CMAEditorInterface editor ) { final String spaceId = getSpaceIdOrThrow ( editor , "editor" ) ; if ( editor . getSystem ( ) . getContentType ( ) == null ) { throw new IllegalArgumentException ( "ContentType of editor interface may not be null!" ) ; } if ( editor . getSystem ( ) . getCo... | Update an editor interface . | 230 | 5 |
42,545 | public Integer delete ( CMAWebhook webhook ) { final String webhookId = getResourceIdOrThrow ( webhook , "webhook" ) ; final String spaceId = getSpaceIdOrThrow ( webhook , "webhook" ) ; return service . delete ( spaceId , webhookId ) . blockingFirst ( ) . code ( ) ; } | Delete a given Webhook . | 76 | 6 |
42,546 | public CMAArray < CMAWebhook > fetchAll ( Map < String , String > query ) { throwIfEnvironmentIdIsSet ( ) ; return fetchAll ( spaceId , query ) ; } | Retrieve specific webhooks matching a query for this space . | 42 | 13 |
42,547 | public CMAArray < CMAWebhookCall > calls ( CMAWebhook webhook ) { final String spaceId = getSpaceIdOrThrow ( webhook , "webhook" ) ; final String webhookId = getResourceIdOrThrow ( webhook , "webhook" ) ; return service . calls ( spaceId , webhookId ) . blockingFirst ( ) ; } | Get more information about a specific webhook . | 81 | 9 |
42,548 | public CMAWebhookCallDetail callDetails ( CMAWebhookCall call ) { final String spaceId = getSpaceIdOrThrow ( call , "call" ) ; final String callId = getResourceIdOrThrow ( call , "call" ) ; assertNotNull ( call . getSystem ( ) . getCreatedBy ( ) . getId ( ) , "webhook.sys.createdBy" ) ; final String webhookId = call . ... | Get more information about one specific call to one specific webhook hosted by one specific space . | 135 | 18 |
42,549 | public CMAWebhookHealth health ( CMAWebhook webhook ) { final String spaceId = getSpaceIdOrThrow ( webhook , "webhook" ) ; final String webhookId = getResourceIdOrThrow ( webhook , "webhook" ) ; return service . health ( spaceId , webhookId ) . blockingFirst ( ) ; } | Return a general understanding of the health of the webhook . | 76 | 12 |
42,550 | public CMAEnvironmentStatus getStatus ( ) { final CMALink link = system . getEnvironmentalStatus ( ) ; if ( link == null ) { return null ; } final String id = link . getId ( ) . toLowerCase ( ) ; for ( final CMAEnvironmentStatus status : CMAEnvironmentStatus . values ( ) ) { final String statusName = status . name ( ) ... | Return the state of this environment | 108 | 6 |
42,551 | public Integer delete ( CMAEnvironment environment ) { assertNotNull ( environment . getSpaceId ( ) , "spaceId" ) ; assertNotNull ( environment . getId ( ) , "environmentId" ) ; return service . delete ( getVersionOrThrow ( environment , "version" ) , environment . getSpaceId ( ) , environment . getId ( ) ) . blockingF... | Delete an environment . | 88 | 4 |
42,552 | @ SuppressWarnings ( "unchecked" ) public < T > T getField ( String key , String locale ) { if ( fields == null ) { return null ; } LinkedHashMap < String , Object > field = fields . get ( key ) ; if ( field == null ) { return null ; } else { return ( T ) field . get ( locale ) ; } } | Return a specific localized field . | 82 | 6 |
42,553 | public CMAEntry setFields ( LinkedHashMap < String , LinkedHashMap < String , Object > > fields ) { this . fields = fields ; return this ; } | Sets a map of fields for this Entry . | 38 | 10 |
42,554 | public CMARole addPolicy ( CMAPolicy policy ) { if ( policies == null ) { policies = new ArrayList < CMAPolicy > ( ) ; } policies . add ( policy ) ; return this ; } | Add a new policy to the existing ones creating a new list if needed . | 45 | 15 |
42,555 | @ Override public JsonElement serialize ( CMAEntry src , Type type , JsonSerializationContext context ) { JsonObject fields = new JsonObject ( ) ; for ( Map . Entry < String , LinkedHashMap < String , Object > > field : src . getFields ( ) . entrySet ( ) ) { LinkedHashMap < String , Object > value = field . getValue ( ... | Make sure all fields are mapped in the locale - value way . | 217 | 13 |
42,556 | @ Override public JsonElement serialize ( CMAField field , Type type , JsonSerializationContext context ) { JsonObject json = new JsonObject ( ) ; add ( json , ATTR_ID , field . getId ( ) ) ; add ( json , ATTR_NAME , field . getName ( ) ) ; add ( json , ATTR_TYPE , field . getType ( ) ) ; add ( json , ATTR_LINK_TYPE , ... | Serialize all fields for content types . | 321 | 8 |
42,557 | @ Override public Response intercept ( Chain chain ) throws IOException { final Request request = chain . request ( ) ; final Request . Builder builder = request . newBuilder ( ) . addHeader ( HEADER_NAME , contentType ) ; if ( request . body ( ) != null ) { rewriteBodyWithCustomContentType ( request , builder ) ; } fi... | Method called by framework to enrich current request with the header information requested . | 96 | 14 |
42,558 | public CMAArray < CMASpaceMembership > fetchAll ( Map < String , String > query ) { throwIfEnvironmentIdIsSet ( ) ; return fetchAll ( spaceId , query ) ; } | Fetch all memberships of the configured space . | 43 | 10 |
42,559 | public CMASpaceMembership fetchOne ( String spaceId , String membershipId ) { assertNotNull ( spaceId , "spaceId" ) ; assertNotNull ( membershipId , "membershipId" ) ; return service . fetchOne ( spaceId , membershipId ) . blockingFirst ( ) ; } | Fetches one space membership by its id from Contentful . | 64 | 13 |
42,560 | public CMAArray < CMAUiExtension > fetchAll ( Map < String , String > query ) { return fetchAll ( spaceId , environmentId , query ) ; } | Fetch all ui extensions from the configured space by a query . | 38 | 14 |
42,561 | public CMAUiExtension update ( CMAUiExtension extension ) { assertNotNull ( extension , "extension" ) ; final Integer version = getVersionOrThrow ( extension , "update" ) ; final String id = getResourceIdOrThrow ( extension , "extension" ) ; final String spaceId = getSpaceIdOrThrow ( extension , "extension" ) ; assertN... | Update a ui extension . | 173 | 6 |
42,562 | public Integer delete ( CMAUiExtension extension ) { assertNotNull ( extension , "extension" ) ; final Integer version = getVersionOrThrow ( extension , "update" ) ; final String spaceId = getSpaceIdOrThrow ( extension , "extension" ) ; assertNotNull ( extension . getEnvironmentId ( ) , "environmentId" ) ; final String... | Delete a ui extension . | 172 | 6 |
42,563 | public Integer delete ( CMAAsset asset ) { final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; return service . delete ( spaceId , environmentId , assetId ) . blockingFirst ( ) . code... | Delete an Asset . | 87 | 4 |
42,564 | public Integer process ( CMAAsset asset , String locale ) { assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; return service . process ( spaceId ... | Process an Asset . | 104 | 4 |
42,565 | public CMAAsset publish ( CMAAsset asset ) { assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; return service . publish ( asset . getSystem ( ) .... | Publish an Asset . | 110 | 5 |
42,566 | public CMAAsset unPublish ( CMAAsset asset ) { assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; return service . unPublish ( spaceId , environme... | Un - Publish an Asset . | 102 | 7 |
42,567 | public CMAAsset update ( CMAAsset asset ) { assertNotNull ( asset , "asset" ) ; final String assetId = getResourceIdOrThrow ( asset , "asset" ) ; final String spaceId = getSpaceIdOrThrow ( asset , "asset" ) ; final String environmentId = asset . getEnvironmentId ( ) ; final Integer version = getVersionOrThrow ( asset ,... | Update an Asset . | 153 | 4 |
42,568 | @ SuppressWarnings ( "unchecked" ) public < T extends CMAResource > T setSystem ( CMASystem system ) { this . system = system ; return ( T ) this ; } | Sets the system field . | 44 | 6 |
42,569 | @ SuppressWarnings ( "unchecked" ) public < T extends CMAResource > T setId ( String id ) { getSystem ( ) . setId ( id ) ; return ( T ) this ; } | Sets the ID for this CMAResource . | 47 | 11 |
42,570 | @ SuppressWarnings ( "unchecked" ) public < T extends CMAResource > T setVersion ( Integer version ) { getSystem ( ) . setVersion ( version ) ; return ( T ) this ; } | Convenience method for setting a version . | 47 | 9 |
42,571 | @ SuppressWarnings ( "unchecked" ) public < T extends CMAResource > T setSpaceId ( String spaceId ) { if ( getSystem ( ) . getSpace ( ) == null ) { getSystem ( ) . space = new CMALink ( CMAType . Space ) ; } getSystem ( ) . space . setId ( spaceId ) ; return ( T ) this ; } | Convenience method for setting a space id . | 87 | 10 |
42,572 | public Integer delete ( CMAContentType contentType ) { final String spaceId = getSpaceIdOrThrow ( contentType , "contentType" ) ; final String environmentId = contentType . getEnvironmentId ( ) ; final String contentTypeId = getResourceIdOrThrow ( contentType , "contentType" ) ; return service . delete ( spaceId , envi... | Delete a Content Type . | 93 | 5 |
42,573 | public CMAArray < CMAContentType > fetchAll ( String spaceId , String environmentId , Map < String , String > query ) { assertNotNull ( spaceId , "spaceId" ) ; DefaultQueryParameter . putIfNotSet ( query , DefaultQueryParameter . FETCH ) ; return service . fetchAll ( spaceId , environmentId , query ) . blockingFirst ( ... | Fetch all Content Types from a Space with query parameters . | 84 | 12 |
42,574 | public CMAContentType publish ( CMAContentType contentType ) { assertNotNull ( contentType , "contentType" ) ; final String contentTypeId = getResourceIdOrThrow ( contentType , "contentType" ) ; final String spaceId = getSpaceIdOrThrow ( contentType , "contentType" ) ; final String environmentId = contentType . getEnvi... | Publish a Content Type . | 113 | 6 |
42,575 | public CMAContentType update ( CMAContentType contentType ) { assertNotNull ( contentType , "contentType" ) ; assertNotNull ( contentType . getName ( ) , "contentType.name" ) ; final String contentTypeId = getResourceIdOrThrow ( contentType , "contentType" ) ; final String spaceId = getSpaceIdOrThrow ( contentType , "c... | Update a Content Type . | 185 | 5 |
42,576 | public CMAArray < CMASnapshot > fetchAllSnapshots ( CMAContentType contentType ) { assertNotNull ( contentType , "contentType" ) ; final String contentTypeId = getResourceIdOrThrow ( contentType , "contentType" ) ; final String spaceId = getSpaceIdOrThrow ( contentType , "contentType" ) ; final String environmentId = c... | Fetch all snapshots of this content type . | 117 | 9 |
42,577 | public CMASnapshot fetchOneSnapshot ( CMAContentType contentType , String snapshotId ) { assertNotNull ( contentType , "contentType" ) ; assertNotNull ( snapshotId , "snapshotId" ) ; final String contentTypeId = getResourceIdOrThrow ( contentType , "contentType" ) ; final String spaceId = getSpaceIdOrThrow ( contentTyp... | Fetch a specific snapshot of this content type . | 133 | 10 |
42,578 | @ Override public CMASnapshot deserialize ( JsonElement json , Type typeOfT , JsonDeserializationContext context ) throws JsonParseException { final CMASnapshot result = new CMASnapshot ( ) ; final JsonObject jsonObject = json . getAsJsonObject ( ) ; final CMASystem system = context . deserialize ( jsonObject . get ( "... | Inspect json payload and generate either a content type snapshot from it or an entry snap shot . | 254 | 19 |
42,579 | public Integer delete ( CMAEntry entry ) { assertNotNull ( entry . getSpaceId ( ) , "spaceId" ) ; assertNotNull ( entry . getEnvironmentId ( ) , "environmentId" ) ; assertNotNull ( entry . getId ( ) , "entryId" ) ; return service . delete ( entry . getSpaceId ( ) , entry . getEnvironmentId ( ) , entry . getId ( ) ) . b... | Delete an Entry . | 102 | 4 |
42,580 | public CMAEntry fetchOne ( String spaceId , String environmentId , String entryId ) { assertNotNull ( spaceId , "spaceId" ) ; assertNotNull ( environmentId , "environmentId" ) ; assertNotNull ( entryId , "entryId" ) ; return service . fetchOne ( spaceId , environmentId , entryId ) . blockingFirst ( ) ; } | Fetch an entry with the given entryId from the given environment and space . | 81 | 16 |
42,581 | public CMAEntry publish ( CMAEntry entry ) { assertNotNull ( entry , "entry" ) ; final String entryId = getResourceIdOrThrow ( entry , "entry" ) ; final String environmentId = entry . getEnvironmentId ( ) ; final String spaceId = getSpaceIdOrThrow ( entry , "entry" ) ; return service . publish ( entry . getSystem ( ) .... | Publish an Entry . | 105 | 5 |
42,582 | public CMAEntry unPublish ( CMAEntry entry ) { assertNotNull ( entry , "entry" ) ; final String entryId = getResourceIdOrThrow ( entry , "entry" ) ; final String spaceId = getSpaceIdOrThrow ( entry , "entry" ) ; final String environmentId = entry . getEnvironmentId ( ) ; return service . unPublish ( spaceId , environme... | Un - Publish an Entry . | 97 | 7 |
42,583 | public CMAEntry update ( CMAEntry entry ) { assertNotNull ( entry , "entry" ) ; final String entryId = getResourceIdOrThrow ( entry , "entry" ) ; final String spaceId = getSpaceIdOrThrow ( entry , "entry" ) ; final String environmentId = entry . getEnvironmentId ( ) ; final Integer version = getVersionOrThrow ( entry ,... | Update an Entry . | 148 | 4 |
42,584 | public CMAArray < CMASnapshot > fetchAllSnapshots ( CMAEntry entry ) { assertNotNull ( entry , "entry" ) ; final String entryId = getResourceIdOrThrow ( entry , "entry" ) ; final String spaceId = getSpaceIdOrThrow ( entry , "entry" ) ; final String environmentId = entry . getEnvironmentId ( ) ; return service . fetchAl... | Fetch all snapshots of an entry . | 106 | 8 |
42,585 | public CMASnapshot fetchOneSnapshot ( CMAEntry entry , String snapshotId ) { assertNotNull ( entry , "entry" ) ; assertNotNull ( snapshotId , "snapshotId" ) ; final String entryId = getResourceIdOrThrow ( entry , "entry" ) ; final String spaceId = getSpaceIdOrThrow ( entry , "entry" ) ; final String environmentId = ent... | Fetch a specific snapshot of an entry . | 122 | 9 |
42,586 | @ Override public Response intercept ( Chain chain ) throws IOException { final Request request = chain . request ( ) ; final Response response = chain . proceed ( request ) ; if ( ! response . isSuccessful ( ) ) { throw new CMAHttpException ( request , response ) ; } return response ; } | Intercepts chain to check for unsuccessful requests . | 64 | 10 |
42,587 | @ Override public Response intercept ( Chain chain ) throws IOException { final Response response = chain . proceed ( chain . request ( ) ) ; final Headers headers = response . headers ( ) ; final Map < String , List < String > > mappedHeaders = headers . toMultimap ( ) ; final RateLimits limits = new RateLimits . Defa... | Intercept a http call . | 102 | 6 |
42,588 | static CMARichNode resolveRichNode ( Map < String , Object > rawNode ) { final String type = ( String ) rawNode . get ( "nodeType" ) ; if ( RESOLVER_MAP . containsKey ( type ) ) { return RESOLVER_MAP . get ( type ) . resolve ( rawNode ) ; } else { return null ; } } | Resolve one node . | 78 | 5 |
42,589 | public CMAPersonalAccessToken addScope ( Scope scope ) { if ( scopes == null ) { scopes = new ArrayList < Scope > ( ) ; } scopes . add ( scope ) ; return this ; } | Add a new scope to the list of scopes . Creates a new list of scopes if no scopes found . | 47 | 25 |
42,590 | public CMASpace create ( CMASpace space ) { assertNotNull ( space , "space" ) ; final CMASystem system = space . getSystem ( ) ; space . setSystem ( null ) ; try { return service . create ( space ) . blockingFirst ( ) ; } finally { space . setSystem ( system ) ; } } | Create a Space . | 72 | 4 |
42,591 | public CMASpace create ( String spaceName , String organizationId ) { assertNotNull ( spaceName , "spaceName" ) ; assertNotNull ( organizationId , "organizationId" ) ; return service . create ( organizationId , new CMASpace ( ) . setName ( spaceName ) . setSystem ( null ) ) . blockingFirst ( ) ; } | Create a Space in an Organization . | 77 | 7 |
42,592 | public CMASpace create ( CMASpace space , String organizationId ) { assertNotNull ( space , "space" ) ; assertNotNull ( space . getName ( ) , "spaceName" ) ; assertNotNull ( organizationId , "organizationId" ) ; final CMASystem system = space . getSystem ( ) ; space . setSystem ( null ) ; try { return service . create ... | Create a Space in an organization . | 110 | 7 |
42,593 | public CMAArray < CMASpace > fetchAll ( Map < String , String > query ) { DefaultQueryParameter . putIfNotSet ( query , DefaultQueryParameter . FETCH ) ; return service . fetchAll ( query ) . blockingFirst ( ) ; } | Fetch all Spaces using specific queries . | 56 | 8 |
42,594 | public CMASpace update ( CMASpace space ) { assertNotNull ( space , "space" ) ; assertNotNull ( space . getName ( ) , "space.name" ) ; final String spaceId = getResourceIdOrThrow ( space , "space" ) ; final Integer version = getVersionOrThrow ( space , "update" ) ; final CMASystem system = space . getSystem ( ) ; space... | Update a Space . | 129 | 4 |
42,595 | static void putIfNotSet ( Map < String , String > target , Map < String , String > defaults ) { for ( final String key : defaults . keySet ( ) ) { if ( ! target . containsKey ( key ) ) { target . put ( key , defaults . get ( key ) ) ; } } } | Update a given map with some default values if not already present in map . | 67 | 15 |
42,596 | public CMASpaceMembership setRoles ( CMALink ... roles ) { if ( roles == null ) { throw new IllegalArgumentException ( "Roles cannot be null!" ) ; } if ( roles . length <= 0 ) { throw new IllegalArgumentException ( "Roles cannot be empty!" ) ; } this . roles = new ArrayList < CMALink > ( Arrays . asList ( roles ) ) ; r... | Replace all roles with the given argument . | 94 | 9 |
42,597 | public CMASpaceMembership addRole ( CMALink role ) { if ( role == null ) { throw new IllegalArgumentException ( "Role cannot be null!" ) ; } if ( roles == null ) { roles = new ArrayList < CMALink > ( ) ; } this . roles . add ( role ) ; return this ; } | Add a role to the list of roles . | 72 | 9 |
42,598 | public CMASpaceMembership setEmail ( String email ) { if ( email == null ) { throw new IllegalArgumentException ( "email cannot be null." ) ; } if ( ! email . contains ( "@" ) ) { throw new IllegalArgumentException ( "email needs to contain an '@' symbol." ) ; } this . email = email ; return this ; } | Set the email address when creating a new membership . | 79 | 10 |
42,599 | private void setCallbackExecutor ( Builder clientBuilder ) { if ( clientBuilder . callbackExecutor == null ) { callbackExecutor = Platform . get ( ) . callbackExecutor ( ) ; } else { callbackExecutor = clientBuilder . callbackExecutor ; } } | Sets the callback executor . | 56 | 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.