Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.sdmlib.models.classes.util;
  
  
  public class RolePO extends PatternObject<RolePORole>
 {
    public RolePO(){
       newInstance(CreatorCreator.createIdMap("PatternObjectType"));
    }
 
    public RolePO(Role... hostGraphObject) {
       if(hostGraphObject==null || hostGraphObject.length<1){
          return ;
       }
       newInstance(CreatorCreator.createIdMap("PatternObjectType"), hostGraphObject);
   }
    @Override
    public RolePO startNAC()
    {
       return (RolePOsuper.startNAC();
    }
    
    @Override
    public RolePO endNAC()
    {
       return (RolePOsuper.endNAC();
    }
    
    public RoleSet allMatches()
    {
       this.setDoAllMatches(true);
 
       RoleSet matches = new RoleSet();
 
       while (this.getPattern().getHasMatch())
       {
          matches.add((Rolethis.getCurrentMatch());
          
          this.getPattern().findMatch();
       }
       
       return matches;
    }
    
    public RolePO hasName(String value)
    {
       new AttributeConstraint()
       .withTgtValue(value)
       .withSrc(this)
       .withModifier(this.getPattern().getModifier())
       .withPattern(this.getPattern());
       
       this.getPattern().findMatch();
       
       return this;
    }
    
    public String getName()
    {
       if (this.getPattern().getHasMatch())
       {
          return ((RolegetCurrentMatch()).getName();
       }
       return null;
    }
    
    public RolePO hasCard(String value)
    {
       new AttributeConstraint()
       .withTgtValue(value)
       .withSrc(this)
       .withModifier(this.getPattern().getModifier())
       .withPattern(this.getPattern());
       
       this.getPattern().findMatch();
       
       return this;
    }
    
    public String getCard()
    {
       if (this.getPattern().getHasMatch())
       {
          return ((RolegetCurrentMatch()).getCard();
       }
       return null;
    }
    
    public RolePO hasKind(String value)
    {
       new AttributeConstraint()
       .withTgtValue(value)
      .withSrc(this)
      .withModifier(this.getPattern().getModifier())
      .withPattern(this.getPattern());
      
      this.getPattern().findMatch();
      
      return this;
   }
   
   public String getKind()
   {
      if (this.getPattern().getHasMatch())
      {
         return ((RolegetCurrentMatch()).getKind();
      }
      return null;
   }
   
   public ClazzPO hasClazz()
   {
      ClazzPO result = new ClazzPO(new Clazz[]{});
      
      result.setModifier(this.getPattern().getModifier());
      super.hasLink(.result);
      
      return result;
   }
   
   public RolePO hasClazz(ClazzPO tgt)
   {
      return hasLinkConstraint(tgt.);
   }
   
   public Clazz getClazz()
   {
      if (this.getPattern().getHasMatch())
      {
         return ((Rolethis.getCurrentMatch()).getClazz();
      }
      return null;
   }
   
   public AssociationPO hasAssoc()
   {
      AssociationPO result = new AssociationPO(new Association[]{});
      
      result.setModifier(this.getPattern().getModifier());
      super.hasLink(.result);
      
      return result;
   }
   
   public RolePO hasAssoc(AssociationPO tgt)
   {
      return hasLinkConstraint(tgt.);
   }
   
   public Association getAssoc()
   {
      if (this.getPattern().getHasMatch())
      {
         return ((Rolethis.getCurrentMatch()).getAssoc();
      }
      return null;
   }
   
   public RolePO hasName(String lowerString upper)
   {
      new AttributeConstraint()
      .withTgtValue(lower)
      .withUpperTgtValue(upper)
      .withSrc(this)
      .withModifier(this.getPattern().getModifier())
      .withPattern(this.getPattern());
      
      this.getPattern().findMatch();
      
      return this;
   }
   
   public RolePO hasCard(String lowerString upper)
   {
      new AttributeConstraint()
      .withTgtValue(lower)
      .withUpperTgtValue(upper)
      .withSrc(this)
      .withModifier(this.getPattern().getModifier())
      .withPattern(this.getPattern());
      
      this.getPattern().findMatch();
      
      return this;
   }
   
   public RolePO hasKind(String lowerString upper)
   {
      new AttributeConstraint()
      .withTgtValue(lower)
      .withUpperTgtValue(upper)
      .withSrc(this)
      .withModifier(this.getPattern().getModifier())
      .withPattern(this.getPattern());
      
      this.getPattern().findMatch();
      
      return this;
   }
   
   public RolePO createName(String value)
   {
      this.startCreate().hasName(value).endCreate();
      return this;
   }
   
   public RolePO createCard(String value)
   {
      this.startCreate().hasCard(value).endCreate();
      return this;
   }
   
   public RolePO createKind(String value)
   {
      this.startCreate().hasKind(value).endCreate();
      return this;
   }
   
   public ClazzPO createClazz()
   {
      return this.startCreate().hasClazz().endCreate();
   }
   public RolePO createClazz(ClazzPO tgt)
   {
      return this.startCreate().hasClazz(tgt).endCreate();
   }
   public AssociationPO createAssoc()
   {
      return this.startCreate().hasAssoc().endCreate();
   }
   public RolePO createAssoc(AssociationPO tgt)
   {
      return this.startCreate().hasAssoc(tgt).endCreate();
   }
New to GrepCode? Check out our FAQ X